asp实现的7xi音乐网的采集源代码(2)
cfg_name = "cfg.txt"
cfg_line = 1
'---读取播放js文件,获得rm文件路径
set httpobj = server.createobject("paopao.http")
str = httpobj.get(v_7xijs_url)
str0 = split(str,"theurl2="&chr(34))
str1 = split(str0(1),chr(34))
v_7ximp3_url = str1(0)
set httpobj = nothing
str = ""
'---数据库连接
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={SQL server};server=localhost;uid=mp3;pwd=mp3;database=mp3db"
'---拼SQL语句execute时需要过滤一下
Function IndbStr(str)
if isNull(str) or str = "" then
IndbStr = str
else
IndbStr = replace(replace(trim(str),"'","''"),"%","")
end if
End Function
'---关闭数据库连接
Function CloseConn()
conn.close
set conn=nothing
End Function
'---取得远程文件并保存到本地
Function GetRemoteFiles(RemotePath, LocalPath, FileName)
Dim strBody
Dim FilePath
On Error Resume Next
'---取得流
strBody = GetBody(RemotePath)
'---取得保存的文件名
if Right(LocalPath, 1) <> "\" then LocalPath = LocalPath & "\"
if not CheckDir(bkfolder) then MakeNewsDir bkfolder
FilePath = LocalPath & GetFileName(RemotePath, FileName)
'---保存文件
if SaveToFile(strBody, FilePath) = true and err.Number = 0 then
GetRemoteFiles = true
else
GetRemoteFiles = false
end if
End Function
'---远程获取内容
Function GetBody(url)
Dim Retrieval
'---建立XMLHTTP对象
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
内容版权声明:除非注明,否则皆为本站原创文章。