📄 mediaplayer.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Example_12_23
{
/// <summary>
/// MediaPlayer的摘要说明。
/// </summary>
public class MediaPlayer : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox Mp3;
protected System.Web.UI.WebControls.TextBox Avi;
protected System.Web.UI.WebControls.TextBox Flash;
protected System.Web.UI.WebControls.TextBox Mpg;
protected System.Web.UI.WebControls.TextBox Mov;
protected System.Web.UI.WebControls.TextBox Rm;
protected System.Web.UI.WebControls.TextBox Mid;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!Page.IsPostBack)
{
SetMediaPlayerCode();
}
}
private void SetMediaPlayerCode()
{
Mid.Text = "<embed src=\" Filename with full URL\" type=\"audio/midi\" hidden=\"false\" autostart=\"true\" loop=\"true\" height=height_num width=width_num></embed>";
Mp3.Text = "<embed controller=\"true\" width=\"width_num\" height=\"height_num\" src=\"Filename with full URL\" border=\"0\" pluginspage=\"http://www.apple.com/quicktime/download/indext.html\"></embed>";
Avi.Text = "<embed src=\"Filename with full URL\" border=\"0\" width=\"width_num\" height=\"height_num\" type=\"application/x-mplayer2\"></embed>";
Flash.Text = "<embed src=\"Filename with full URL\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"width_num\" height=\"height_num\" play=\"true\" loop=\"true\" quality=\"high\" scale=\"showall\" menu=\"true\"></embed>";
Mpg.Text = "<embed src=\"Filename with full URL\" border=\"0\" width=\"width_num\" height=\"height_num\" type=\"application/x-mplayer2\"></embed>";
Mov.Text = "<embed controller=\"true\" width=\"width_num\" height=\"height_num\" src=\"Filename with full URL\" border=\"0\" pluginspage=\"http://www.apple.com/quicktime/download/indext.html\"></embed> ";
Rm.Text = "<OBJECT VIEWASTEXT><PARAM NAME=\"CONTROLS\" VALUE=\"ImageWindow\"><PARAM NAME=\"AUTOSTART\" VALUE=\"true\"><PARAM NAME=\"SRC\" VALUE=\"Filename with full URL\"><embed height=\"30\" width=\"200\" controls=\"ImageWindow\" src=\"Filename with full URL\" type=\"audio/x-pn-realaudio-plugin\"autostart=\"true\" nolabels=\"0\" autogotourl=\"-1\"></OBJECT>";
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -