复制代码 代码如下:
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;
///
/// PlayClass 的摘要说明
///
namespace ConfigTools
{
///
/// PlayClass 的摘要说明。
///原作CSDN,经本人稍加修改
///
public class PlayClass
{
public PlayClass()
{
//
// TOD 在此处添加构造函数逻辑
//
}
public string Play(string url,int width,int height)
{
string strTmp = url.ToLower();
if(strTmp.EndsWith(".wmv")||strTmp.EndsWith(".mp3")||strTmp.EndsWith(".wma")||strTmp.EndsWith(".avi")||strTmp.EndsWith(".asf")||strTmp.EndsWith(".mpg"))
{
return wmv(url,width, height);
}
else if(strTmp.EndsWith(".mp3"))
{
return mp3(url,width,height);
}
else if(strTmp.EndsWith(".swf"))
{
return swf(url,width, height);
}
else if(strTmp.EndsWith(".jpg")||strTmp.EndsWith(".gif"))
{
return img(url,width, height);
}
else if(strTmp.EndsWith(".rm"))
{
return rm(url,width, height);
}
else
{
return "数据错误";
}
}
///
/// wmv格式文件播放
///
///
///
private string wmv(string url, int width, int height)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("
\n");
return sb.ToString();
}
private string wma(string url,int width, int height)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("");
return sb.ToString();
}
///
/// avi格式文件播放
///
///
///
private string avi(string url,int width, int height)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("");
return sb.ToString();
}
private string mpg(string url, int width, int height)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("");
return sb.ToString();
}
private string rm(string url, int width, int height)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("");
return sb.ToString();
}
private string swf(string url, int width, int height)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("");
return sb.ToString();
}
private string mp3(string url, int width, int height)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("");
return sb.ToString();
}
private string img(string url, int width, int height)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("");
return sb.ToString();
}
}
}