给这个ASP代码每一行都加上解释

来源:百度知道 编辑:UC知道 时间:2024/05/17 21:47:48
<%
SongUrl=request("checked")
dim SongUrlArray(20)
randomize
SongUrl=trim(SongUrl)
if instr(SongUrl,",")=0 then
SongUrlArray(0)=SongUrl
else
SongUrl=replace(SongUrl," ","")
SongUrlArrayNew=split(SongUrl,",")
FoundNew=1
end if
if FoundNew=1 then
s=""
for intI=0 to ubound(SongUrlArrayNew)
s=s & SongUrlArrayNew(intI) & vbCrLf
next
else
s=SongUrl
end if
s=s&" "&vbCrLf
response.contenttype="audio/x-pn-realaudio"
response.addheader "Content-Disposition","inline; filename=playsong.ram"
response.write s
source="playsong.ram"
response.end
%>

<%
SongUrl=request("checked") 获取歌曲地址
dim SongUrlArray(20) 定义歌曲url的数组
randomize 随机组合
SongUrl=trim(SongUrl) 去掉地址左右空格
if instr(SongUrl,",")=0 then 如果url中不存在逗号
SongUrlArray(0)=SongUrl 数组url第一个值赋值为songurl
else 如果不是继续替换...
SongUrl=replace(SongUrl," ","")
SongUrlArrayNew=split(SongUrl,",")
FoundNew=1
end if
if FoundNew=1 then 如果foundnew变量为1
s=""
for intI=0 to ubound(SongUrlArrayNew) 循环组合数组songurlarraynew中存储的内容,并赋值到s
s=s & SongUrlArrayNew(intI) & vbCrLf 对s进行累加组合
next
else 如果不是1,那么s直接就是上面得到的songurl
s=SongUrl
end if

s=s&" "&vbCrLf 在s内容后加一个空格和回车符

response.contenttype="audio/x-pn-realaudio" 设置s的文件头为音频格式
response.addheader "Content-Disposition","inline; filename=playsong.ram" 命名为playsong.ram
response.write s 将歌曲的地址写入到playsong.ra