ASP.NET实现在线播放FLV视频件的代码
ASP.NET实现在线播放FLV视频件的代码
前台调用代码
<!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 id="Head1"
runat="server">
<title>视频播放</title>
</head>
<body>
<form
id="form1" runat="server">
<div>
<table>
<tr>
<td><div id="video_content"
runat="server" style=""></div> </td>
</tr>
</table>
</div>
</form>
</body>
</html>
后台调用代码
protected void Page_Load(object sender, EventArgs e)
{
this.video_content.InnerHtml =
PlayMedia.Play("http://hot.tudou.com/flv/005/680/205/5680205.flv",
472,385);
}
视频播放类:
using System;
using System.Collections.Generic;
using
System.Text;
namespace Common
{
public class PlayMedia
{
public PlayMedia()
{
//
// TOD 在此处添加构造函数逻辑
//
}
public static string Play(string url, int width, int
height)
&
相关文档:
命名空间:
Socut.Data
//##################### CData 类 #####################
实现功能:读取(DataSet方式),插入,更新,删除,统计
调用方法:
public CData myData=new CData();
实际操作:
1,读取
public DataSet ds=new DataSet(); //此DataSet类已经由微软封装提供
ds=myData.GetDataSet("SELECT * from ......
看过微软的网站有时候,是.MSPX的扩展名?其实你也可以配置,很简单。Here We Go!
配置WEB.CONFIG:
<system.web>
<compilation>
<buildProviders>
<add ......
string LogPath;
Thread thread;
void WriteLog()
{
while (true)
{
StreamWriter sw = new StreamWriter(LogPath, true, Encoding.UTF8);
sw.WriteLine(thread.Name + ":" + DateTime.Now.ToString());
sw.Close();
Thr ......
ASP.NET程序中常用的三十三种代码
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
接收参数:
string a = Request.QueryString("id");
string& ......
如何在客户端直接调用WebService中的方法?
这里结合经验自己写一写
1.首先新建一个 ASP.NET AJAX-Enabled Web Site,这样系统为我们自动配置好了环境,这主要体现在Web.config这个文件上,如果已有网站不是ASP.NET AJAX-Enabled Web Site也可以对照修改下Web.config,也可以达到相同的效果。
2.新建一个web服务,WebSer ......