首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

请大家教教我该如何做啊

2011-12-10 
请大家教教我该怎么做啊?我现在想用ASP。NET做一个音乐网站,但是不知道怎么把播放器放到页面上,后来我就想

请大家教教我该怎么做啊?
我现在想用ASP。NET做一个音乐网站,但是不知道怎么把播放器放到页面上,后来我就想干脆做一个页面,设置这个页面的背景音乐的路径等于传进来的歌的路径不就相当是试听这个歌了吗``?但是在设置这个页面的BGSOUND的路径的时候路径应该怎么写呢?如果是用一个变量,前面的页面应该怎么把值传个这个变量呢?

望大家给我指点指点```谢谢了

如果谁知道ASP。NET里有自带的简单的播放器就更好了```

[解决办法]
<%=m_strFileUrl%>
[解决办法]
在工具箱,右键-> 添加/移除项,然后在“COM组件”里面,选中“Windows Media Player”并确定。
然后把工具箱里面的Windows Media Player拖放到你的页面上就可以了,在属性窗口里面可以设置属性,或者右键-> 属性,来设置属性
[解决办法]
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;

public partial class csdn : System.Web.UI.Page
{
public string m_strFileUrl;

protected void Page_Load(object sender, EventArgs e)
{
// m_strFileUrl = "E:\\TDDownload\\china vs japanese pig.rm ";D:\Just Game\mp3
m_strFileUrl = "D:\\Just Game\\mp3\\AVSEQ05.DAT ";
}
}

[解决办法]
string MideaPlayer= " ";
MideaPlayer+= " <TABLE id=\ "Table11\ " height=\ "100%\ " cellSpacing=\ "0\ " cellPadding=\ "0\ " width=\ "100%\ " border=\ "0\ "> ";
MideaPlayer+= " <TR bgcolor=\ "#f3e2a6\ " height=\ "22\ " width=\ "100%\ "> ";
MideaPlayer+= " <TD width=\ "100%\ " align=\ "Center\ " bgColor=\ "AliceBlue\ "> <FONT face=\ "宋体\ " color=\ "Red\ " size=\ "5\ "> ";
MideaPlayer+= "飞狐精品短片点播: ";
MideaPlayer+= " </TD> </FONT> ";
MideaPlayer+= " </TR> ";
MideaPlayer+= " <TR bgcolor=\ "GhostWhite\ " height=\ "192\ " width=\ "100%\ "> ";
MideaPlayer+= " <TD width=\ "100%\ " align=\ "Center\ "> ";
MideaPlayer+= " <OBJECT id=\ "MediaPlayer\ " style=\ "WIDTH: 608px; HEIGHT: 496px\ " codeBase=\ "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,1,5,217\ " " ;
MideaPlayer+= "type=\ "application/x-oleobject\ " height=\ "248\ " standby=\ "Loading Microsoft Windows Media Player components..\ " width=\ "304\ " align=\ "middle\ " classid=\ "clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\ " VIEWASTEXT> ";
MideaPlayer+= " <param name=Filename value=\ "video/ "+file+ "\ "> ";
MideaPlayer+= " <param name=ShowStatusBar value=-1> ";
MideaPlayer+= " <param name=AutoStart value=1> ";
MideaPlayer+= " <param name=BufferingTime value=5> ";
MideaPlayer+= " </OBJECT> ";
MideaPlayer+= " </TD> ";
MideaPlayer+= " </TR> ";
MideaPlayer+= " </TABLE> ";
我是动态输出此html代码!
[解决办法]
用COM组件或者用Real的代码

播放框:
<object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=285 id=RAOCX name=rmplay width=356>
<param name= "SRC " value= "影片地址 ">


<param name= "CONSOLE " value= "Clip1 ">
<param name= "CONTROLS " value= "imagewindow ">
<param name= "AUTOSTART " value= "true ">
<embed src= "影片地址 " autostart= "true " controls= "ImageWindow " console= "Clip1 " pluginspage= "http://www.real.com "/’ target= "_blank " > http://www.real.com "; width= "356 " height= "285 ">
</embed>  
</object>
控制框:可紧跟播放框一起
<object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=27 id=video1 width=356>
<param name= "_ExtentX " value= "7276 ">
<param name= "_ExtentY " value= "1058 ">
<param name= "AUTOSTART " value= "0 ">
<param name= "SHUFFLE " value= "0 ">
<param name= "PREFETCH " value= "0 ">
<param name= "NOLABELS " value= "0 ">
<param name= "CONTROLS " value= "ControlPanel ">
<param name= "CONSOLE " value= "Clip1 ">
<param name= "LOOP " value= "0 ">
<param name= "NUMLOOP " value= "0 ">
<param name= "CENTER " value= "0 ">
<param name= "MAINTAINASPECT " value= "0 ">
<param name= "BACKGROUNDCOLOR " value= "#ffffff ">
<embed type= "audio/x-pn-realaudio-plugin " console= "Clip1 " controls= "ControlPanel " height= "27 " width= "356 " autostart= "0 " _extentx= "7276 " _extenty= "1058 " shuffle= "0 " prefetch= "0 " nolabels= "0 " loop= "0 " numloop= "0 " center= "0 " maintainaspect= "0 " backgroundcolor= "#ffffff ">
</embed>
</object>

热点排行