如何实现歌曲在线点播?

2023-12-07 0 127

<%dim choose,path,mydb,myset,SQL,fs,mp3\’ 获得用户提交表单(list.htm)选中的曲目对应的id,并将其赋给字串变量choose. choose=(\”for i=3 to request.form.countchoose=chooserequest.form(i)+“,\”nextchoose=left(choose,len(choose)1)+“)\”if choose=()\” thenresponse.redirect(list.htm\”)

response.end

\’ 判断choose变量,如果不包含id,说明list.htm中没有选中任何歌曲,终止程序.end ifpath=E:\\inetpub\\wwwroot\\temp\\\”

\’ 设置文件路径,temp目录的权限设为对internet匿名用户具有read write 权限.Set fs = CreateObject(Scripting.FileSystemObject\”)Set mp3 = fs.CreateTextFile(path+“listen.m3u\”, True)

\’ 创建文件对象. set mydb=server.createobject(adodb.connection\”)

\’ 创建数据库对象. mydb.open music\”SQL=select mp3name,url from \”dbname&“where id in \”choose set myset=tdb.execute(SQL)do while not myset.eof

\’ 检索数据库,获得曲目信息.mp3.Write(http://\”myset(url\”)chr(10))myset.movenext

\’ 生成点播曲目文件列表.loopSQL=update music set click=click1,this=this1 where id in \”choosemydb.execute(SQL)

\’ 更新数据库中的当天点播次数和总共点播次数.set myset=nothingmydb.closeset mydb=nothingmp3.closeset mp3=nothing

\’ 清空.response.redirect(listen.m3u\”)

\’ 将该文件下传到用户.response.end%>

[1]

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 编程10000问 如何实现歌曲在线点播? https://www.u-9.cn/biancheng/bc10000/126509.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务