谁能给个在线视频的例子?
用一个摄像头 一个麦,做视频直播,各位教教我!分不够再加 --------------------编程问答-------------------- 找本有此类型的项目开发的书看看 --------------------编程问答-------------------- 我记着清华大学出版社有本此类的书 --------------------编程问答-------------------- 我这下有VS2005源码,不过没用过,楼主如果需要,可以跟我联系。mengxj@yeah.net --------------------编程问答--------------------
--------------------编程问答--------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>在线点播系统</title>
<link href="css/bodys.css" rel="stylesheet" type="text/css" />
</head>
<body topmargin=0 style="text-align: center">
<form id="form1" runat="server">
<TABLE BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0 style="height: 522px; width: 446px;">
<TR>
<TD COLSPAN=1 style="height: 85px; text-align: center; width: 519px;">
<span style="font-size: 16pt"><strong>在线点播系统</strong></span></TD>
</TR>
<TR>
<TD valign="top" align=center style="height: 431px; width: 519px; text-align: center;">
<asp:DataList ID="dlList" runat="server" Width="502px">
<ItemTemplate>
<table border="1" cellspacing="0">
<tr>
<td style="width: 129px">
影片编号:</td>
<td colspan="2" align="left">
<asp:Label ID="labID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"ID") %>'></asp:Label></td></tr>
<tr>
<td style="width: 129px">
影片名称:</td>
<td style="width: 230px" align="left">
<asp:Label ID="labFilmName" runat="server" Text=<%#DataBinder.Eval(Container.DataItem,"FilmName") %>></asp:Label></td><td style="width: 160px">
<asp:CheckBox ID="CheckBox1" runat="server"/></td>
</tr>
<tr>
<td style="width: 129px">
影片简介:</td>
<td colspan="2" align="left">
<%#DataBinder.Eval(Container.DataItem, "Explain")%>
</td>
</tr>
</table>
</ItemTemplate>
<SeparatorTemplate>
<hr color="#00cc00" />
</SeparatorTemplate>
</asp:DataList>
<table style="width: 495px">
<tr>
<td style="width: 75px; height: 29px; text-align: center;">
<asp:Button ID="btnPlay" runat="server" Text="播放文件" OnClick="btnPlay_Click" Font-Size="9pt" /></td>
<td colspan="3" style="width: 119px; height: 29px; text-align: center;">
当前页码:<asp:Label ID="labCurrently" runat="server" ForeColor="Red" Text="1"></asp:Label>/<asp:Label
ID="labTotel" runat="server" Text="Label"></asp:Label></td>
<td style="width: 33px; height: 29px;">
<asp:Button ID="btnFirst" runat="server" Text="第一页" OnClick="btnFirst_Click" Font-Size="9pt" /></td>
<td style="width: 49px; height: 29px;">
<asp:Button ID="btnUp" runat="server" Text="上一页" OnClick="btnUp_Click" Font-Size="9pt" /></td>
<td style="width: 59px; height: 29px;">
<asp:Button ID="btnNext" runat="server" Text="下一页" OnClick="btnNext_Click" Font-Size="9pt" /></td>
<td style="width: 70px; height: 29px;">
<asp:Button ID="btnLast" runat="server" Text="最后一页" OnClick="btnLast_Click" Font-Size="9pt" /></td>
</tr>
</table>
</TD>
</TR>
</TABLE>
</form>
</body>
</html>
--------------------编程问答-------------------- 你给的代码好像是播放视频的吧?我要的是在线视屏,呵呵 --------------------编程问答-------------------- BaseClass是什么? --------------------编程问答-------------------- --------------------编程问答-------------------- 51aspx上有一个 flex 的。。去搜吧 --------------------编程问答-------------------- http://www.datastead.com/products/tvideograbber/download.html
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.IO;
using System.Text;
public partial class _Default : System.Web.UI.Page
{
BaseClass baseclass = new BaseClass();
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
this.dlBind();
}
}
protected void btnPlay_Click(object sender, EventArgs e)
{
StreamWriter srd = new StreamWriter(Server.MapPath("Video/list.m3u"),false, System.Text.Encoding.GetEncoding("gb2312"));
for (int i = 0; i < dlList.Items.Count; i++)
{
if (((CheckBox)dlList.Items[i].FindControl("CheckBox1")).Checked == true)
{
srd.Write("http://" + Request.ServerVariables["LOCAL_ADDR"] + "/Video/" + baseclass.filmName("select FilmPath from tb_22 where id=" + ((Label)dlList.Items[i].FindControl("labID")).Text) + "\n\r");
}
}
srd.Close();
Response.Redirect("Video/list.m3u");
}
public void dlBind()
{
int curpage = Convert.ToInt32(this.labCurrently.Text);
PagedDataSource ps = new PagedDataSource();
ps.DataSource = baseclass.SqlDs("select * from tb_22", "tb_22").Tables["tb_22"].DefaultView;
ps.AllowPaging = true; //是否可以分页
ps.PageSize = 6; //显示的数量
ps.CurrentPageIndex = curpage - 1; //取得当前页的页码
this.btnUp.Enabled = true;
this.btnNext.Enabled = true;
this.btnFirst.Enabled = true;
this.btnLast.Enabled = true;
if (curpage == 1)
{
this.btnFirst.Enabled = false;//不显示第一页按钮
this.btnUp.Enabled = false;//不显示上一页按钮
}
if (curpage == ps.PageCount)
{
this.btnNext.Enabled = false;//不显示下一页
this.btnLast.Enabled = false;//不显示最后一页
}
this.labTotel.Text=Convert.ToString(ps.PageCount);
this.dlList.DataSource = ps;
this.dlList.DataBind();
}
protected void btnUp_Click(object sender, EventArgs e)
{
this.labCurrently.Text = Convert.ToString(Convert.ToInt32(this.labCurrently.Text) - 1);
this.dlBind();
}
protected void btnNext_Click(object sender, EventArgs e)
{
this.labCurrently.Text = Convert.ToString(Convert.ToInt32(this.labCurrently.Text) + 1);
this.dlBind();
}
protected void btnFirst_Click(object sender, EventArgs e)
{
this.labCurrently.Text = "1";
this.dlBind();
}
protected void btnLast_Click(object sender, EventArgs e)
{
this.labCurrently.Text = this.labTotel.Text;
this.dlBind();
}
}
my blog
http://ufo-crackerx.blog.163.com/
补充:.NET技术 , ASP.NET