简单asp音乐连播问题

Kesin_Xu 2008-03-29 12:45:59
请教前辈,asp实现音乐连播的问题 没有实现
方案:
列表页:复选框 赋值<%=rs("playurl")%> 表单提交到播放页
播放页有播放器(media player) 其中filename value="<%
dim strChecks,aryChecks
strChecks = Request.Form("muid")
aryChecks = split(strChecks,",")
Response.Write ("<ASX Version = ""3.0"">")
for i=0 to uBound(aryChecks)
Response.Write ("<Entry>")
Response.Write ("<Ref href =""" & aryChecks(i) & """/>")
Response.Write ("</Entry>")
next
response.write "</ASX>"
%>"

以下为那两页的源文件(请高手不吝赐教):
列表页:
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function selectAll()
{
for(var i=0;i<document.form1.muid.length;i++)
{
document.form1.muid[i].checked=true;
}
}
function unSelect()
{
for(var i=0;i<document.form1.muid.length;i++)
{
if(document.form1.muid[i].checked)
{
document.form1.muid[i].checked=false;
}
else
{
document.form1.muid[i].checked=true;
}
}
}
</script>

</head>

<body>
<%set rsm=server.CreateObject("adodb.recordset")
str="select top 10 * from music order by id desc"
rsm.open str,conn,1,1
%>
<form id="form1" name="form1" method="post" action="c.asp">
<table width="600" border="1" bordercolor="#006699">
<%do while not rsm.eof%>
<tr>
<td><label>
<input type="checkbox" name="muid" id="checkbox" value="<%=trim(rsm("playurl"))%>" />
</label></td>
<td><%=rsm("title")%></td>
<td> </td>
</tr>
<%rsm.movenext
loop
rsm.close
set rsm=nothing
%>
</table>
<p>
<label>
<input type="submit" name="button" id="button" value="提交" />
</label>
     <input type="button" value="全选" onClick="selectAll();">
       <input type="button" value="反选" onClick="unSelect();"> </p>
<p> </p>
<p> </p>
<p> </p>
</form>
</body>
</html>

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
播放页:
<object id="mplayer"classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" align="center" border="0" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="FileName" value="<%
dim strChecks,aryChecks
strChecks = Request.Form("muid")
aryChecks = split(strChecks,",")
Response.Write ("<ASX Version = ""3.0"">")
for i=0 to uBound(aryChecks)
Response.Write ("<Entry>")
Response.Write ("<Ref href =""" & aryChecks(i) & """/>")
Response.Write ("</Entry>")
next
response.write "</ASX>"
%>">
<param name="ShowControls" value="1">
<param name="ShowPositionControls" value="1">
<param name="ShowAudioControls" value="1">
<param name="ShowTracker" value="1">
<param name="ShowDisplay" value="0">
<param name="ShowStatusBar" value="1">
<param name="AutoSize" value="0">
<param name="ShowGotoBar" value="0">
<param name="ShowCaptioning" value="0">
<param name="AutoStart" value="1">
<param name="PlayCount" value="0">
<param name="AnimationAtStart" value="0">
<param name="TransparentAtStart" value="0">
<param name="AllowScan" value="0">
<param name="EnableContextMenu" value="1">
<param name="ClickToPlay" value="0">
<param name="InvokeURLs" value="1">
<param name="DefaultFrame" value="datawindow">
</object>


...全文
103 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
guangen 2009-04-23
  • 打赏
  • 举报
回复

看看这个:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>MUSIC</title>
</head>

<body>

<OBJECT id=Player style="LEFT: 0px; POSITION: relative; height:62px;width:100%"
type=application/x-oleobject classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6>
<PARAM NAME="URL" VALUE="Song.asp?pid=<%=Request.Form("pid")%>">
<PARAM NAME="autoStart" VALUE="true">
<PARAM NAME="playCount" VALUE="2">
</OBJECT>
</body>
</html>

song.asp

<!--#include file="conn.asp"-->
<ASX Version="3.0" PREVIEWMODE="NO">
<%
str=Request.QueryString("pid")
str=split(str,",")
for i = 0 to ubound(str)
ON ERROR RESUME NEXT
sql="select * from [list] where id="&str(i)&" order by id desc"
Set rs=conn.execute(sql)
t=1
do while not rs.eof
%>
<entry>
<ref href="<%=rs("mc_path")%>" />
<Title><%=rs("name")%></Title>
<Author><%=rs("singer")%></Author>
</entry>
<%
t=t+1
rs.movenext
loop
next
rs.close
%>
</ASX>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧