问题描述
在asp.net中,单击datagrid某一行歌曲,如何播放对应歌曲?谢谢!(建一个音乐网站)
解决方案
解决方案二:
要用到音乐播放控件
解决方案三:
不明白问题描述,,,首先,音乐播放控件是必须的,比如:windowsmediaplayer,点击某一行的时候,从数据库中读出音乐文件的目录,将目录传给控件,
解决方案四:
functionplay(){varPlayer=document.getElementById("mPlayer1");varlistMusic=document.getElementById("<%=lboxMyMusic.ClientID%>");varurl=listMusic.options[listMusic.selectedIndex].value;if(listMusic.selectedIndex!=null){Player.URL=url;Player.controls.play();getNextMusic();}return;}functiongetNextMusic(){if(document.getElementById("mPlayer1").playState==1){NextPlay();}setTimeout("getNextMusic()",500);}functionNextPlay(){varPlayer=document.getElementById("mPlayer1");varlistMusic=document.getElementById("<%=lboxMyMusic.ClientID%>");if(listMusic.selectedIndex>=0){if((listMusic.selectedIndex+1)<=listMusic.length-1){listMusic.options[listMusic.selectedIndex+1].selected=true;play();}else{listMusic.options[0].selected=true;play();}}}
<OBJECTcodeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"height="350"width="100%"classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><PARAMNAME="_cx"VALUE="25003"><PARAMNAME="_cy"VALUE="9260"><PARAMNAME="FlashVars"VALUE=""><PARAMNAME="Movie"VALUE="Navigation/snow.swf"><PARAMNAME="Src"VALUE="Navigation/snow.swf"><PARAMNAME="WMode"VALUE="Transparent"><PARAMNAME="Play"VALUE="-1"><PARAMNAME="Loop"VALUE="-1"><PARAMNAME="Quality"VALUE="High"><PARAMNAME="SAlign"VALUE=""><PARAMNAME="Menu"VALUE="-1"><PARAMNAME="Base"VALUE=""><PARAMNAME="AllowScriptAccess"VALUE=""><PARAMNAME="Scale"VALUE="ShowAll"><PARAMNAME="DeviceFont"VALUE="0"><PARAMNAME="EmbedMovie"VALUE="0"><PARAMNAME="BGColor"VALUE=""><PARAMNAME="SWRemote"VALUE=""><PARAMNAME="MovieData"VALUE=""><PARAMNAME="SeamlessTabbing"VALUE="1"><PARAMNAME="Profile"VALUE="0"><PARAMNAME="ProfileAddress"VALUE=""><PARAMNAME="ProfilePort"VALUE="0"><embedsrc="Navigation/snow.swf"quality="high"pluginspage="http://www.macromedia.com/go/getflashplayer"type="application/x-shockwave-flash"width="100%"height="350"wmode="transparent"></embed></OBJECT><asp:ListBoxID="lboxMyMusic"runat="server"Width=100%ForeColor=blueHeight=150px></asp:ListBox>
解决方案五:
用C#.net做,实现出来就像我们平时在音乐网站听歌差不多,点击则播放,该怎么做?