麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁(yè) > 開(kāi)發(fā) > XML > 正文

用XMLHTTP很好的一個(gè)例子

2024-09-05 20:56:14
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
雖然ting88沒(méi)有注冊(cè)的用戶(hù)不能下載歌曲,但搞定它也非難事啊:)

進(jìn)入www.ting88.com的網(wǎng)站,把歌手專(zhuān)輯頁(yè)面的URL復(fù)制到文本框中再提交就可以得到歌曲的下載路徑,如:http://www.ting88.com/MusicList/4141.htm

源程序如下:

以下為引用的內(nèi)容:
<%
on error resume next
dim id,url,getCode,m,i,j,s,d,ns,nd,num,name
id=trim(request.querystring("id"))
'1.獲取原網(wǎng)頁(yè)所有內(nèi)容
Function getHTTPPage(url)
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
End function

'2.編碼轉(zhuǎn)換
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
以下為引用的內(nèi)容:
'得到明碼URL
function MyReplace(ConvStr)
ConvStr=replace(ConvStr,"YVI","1")
ConvStr=replace(ConvStr,"ESR","2")
ConvStr=replace(ConvStr,"SXN","3")
ConvStr=replace(ConvStr,"STI","4")
ConvStr=replace(ConvStr,"WFU","5")
ConvStr=replace(ConvStr,"LQU","6")
ConvStr=replace(ConvStr,"QGI","7")
ConvStr=replace(ConvStr,"BLA","8")
ConvStr=replace(ConvStr,"JFU","9")
ConvStr=replace(ConvStr,"LSN","0")
ConvStr=replace(ConvStr,"XPG","/")
ConvStr=replace(ConvStr,"XQD",".")
ConvStr=replace(ConvStr," ","")
ConvStr=replace(ConvStr,"%20","")
ConvStr=replace(ConvStr,"KWD","Wma")
MyReplace=ConvStr
end function

if id="1" then
url=trim(request.form("txturl"))
if url="" then
response.redirect("GetMusic.asp")
response.end()
end if
'url="http://www.ting88.com/MusicList/1454.htm"
s=0
d=0
ns=0
nd=0
getCode=getHTTPPage(url)
num=mid(getCode,instrrev(getCode,".<a href")-3,2) '獲取歌曲的數(shù)目
name=mid(getCode,instr(getCode,"歌手姓名:")+5,10) '獲取歌手
m="http://218.75.78.189/33445566/"
response.write "<center>該面頁(yè)共找到 " & name & "的 <font color=red>" & num& "</font> 首歌曲" & "<br/><br/>"
response.write "<table width='80%' border='1' bordercolor='#A4C8FF' cellpadding='0' cellspacing='0'><tr><td>頁(yè)面URL:<a href='" & url & "' target='_blank'>" & url & "</a></td></tr></table><hr width='80%'>"
response.write "<table width='80%' border='0' cellpadding='0' cellspacing='0' bgcolor='#A4C8FF'><tr><td><table border='0' width='100%' cellpadding='2' cellspacing='1'><tr><td align=center bgcolor='#FFFFFF'>序號(hào)</td><td align=center bgcolor='#FFFFFF'>歌名</td><td align=center bgcolor='#FFFFFF'>操作</td></tr>"
for i=1 to num
s=instr(i+s,getCode,"checked"" value='")
d=instr(i+d,getCode,"KWD'>")
ns=instr(i+ns,getCode,"word=")
nd=instr(i+nd,getCode,"&inc=")
response.write " <tr><td align=center bgcolor='#FFFFFF'>" & i & "</td><td bgcolor='#FFFFFF'> <a href='" & m & MyReplace(mid(getCode,s+16,d-s-13)) & "'>" & mid(getCode,ns+5,nd-ns-5) & "</a><br/></td><td align=center bgcolor='#FFFFFF'><a href='" & m & MyReplace(mid(getCode,s+16,d-s-13)) & "'>下載</a></td></tr>"
next
response.write "</table></td></tr></table></center>"
end if



%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>獲取專(zhuān)輯歌曲的URL地址</title>
</head>
<body>
<form name="form1" method="post" action="GetMusic.asp?id=1">
<table width='80%' border='0' align="center" cellpadding='0' cellspacing='0' bgcolor='#A4C8FF'>
<tr><td><table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td height="30">獲取專(zhuān)輯歌曲的URL地址</td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF">網(wǎng)頁(yè)地址:
<input name="txturl" type="text" id="txturl" size="80" maxlength="100"></td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF"> <input type="submit" name="Submit" value="提 交" style="width:60">
<input name="Reset" type="reset" id="Reset" value="重 置" style="width:60"></td>
</tr>
</table></td></tr></table>
</form>
</body>
</html>

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 国内精品久久久久影院不卡 | 一区二区三区手机在线观看 | 在线视频 中文字幕 | 国产成年人小视频 | 嗯~啊~用力~高h | h视频免费在线观看 | 国产自在线 | 久久免费视频一区二区三区 | 午夜精品一区二区三区免费 | av在线直播观看 | 在线视频观看一区二区 | 亚洲特黄妇女高潮 | 久久国产精品小视频 | 中文字幕一区2区 | 久久精品观看 | 久久男人天堂 | 国产成人自拍av | 日本aⅴ在线 | 亚洲成年人免费网站 | 成人超碰97| 色婷婷a v| 色综合久久99| 成年免费视频黄网站在线观看 | 2019中文字幕在线播放 | 久草在线最新免费 | 91精品国产99久久久久久红楼 | 黄色大片在线观看 | 成人免费精品视频 | 色妞欧美 | 国产成人av在线播放 | 欧美大胆xxxx肉体摄影 | 亚洲人成电影在线 | 国产精品18久久久久久久久 | 精品国产精品久久 | 91精品国产综合久久婷婷香 | 今井夏帆av一区二区 | 久久久久久久久国产 | 亚洲一区二区不卡视频 | 亚洲欧美日韩中文在线 | 日本高清黄色片 | 国产美女的小嫩bbb图片 |