非常不错的flash采集程序测试通过

时间:2021-05-25

复制代码 代码如下:

<%
'--------------------------------------------------------------
Dbname="../data/flash.mdb"'更改数据库文件位置,强烈建议更改为.asp的文件!
SetConn=Server.CreateObject("ADODB.Connection")
Connstr="Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&Server.Mappath(Dbname)
Conn.OpenConnstr


'------------------------------------------------------------
SetList=Conn.Execute("Select*FromSystem")
WebName=List("WebName")
WebUrl=List("WebUrl")
webemail=List("webemail")
zzname=List("zzname")
qq=List("webqq")

%>

复制代码 代码如下:
<%
ifrequest("id")andrequest("overid")andrequest("download")<>""then
response.redirect"getid.asp?id="&request("id")&"&overid="&request("overid")&"&download="&request("download")
else
%>
<body>
<P>&nbsp;</P>
<formname="form1"method="get"action="getid.asp">
开始采集的专辑ID号:
<inputname="id"type="text"id="id"size="10">
结束ID:
<inputname="overid"type="text"id="overid"size="10">
是否将数据下载到本地:是
<inputtype="radio"name="download"value="yes">

<inputname="download"type="radio"value="no"checked>
<inputtype="submit"name="Submit"value="提交">
</form>
</body>
</html>
<%endif%>

复制代码 代码如下:
<!--#includeFile="Conn.asp"-->
<%
Server.ScriptTimeOut=999999999
%>
<%
ifrequest("overid")=""then
response.write"结束ID不可为空"
response.end
elseifrequest("download")=""then
response.write"请选择是否下载"
response.end
endif
ifrequest("id")=request("overid")then
response.write"采集任务结束"
response.end
endif
gourl1=request("id")
gourl1=gourl1+1
%>
<%
functionGetPy(Str)
fori=1tolen(Str)
GetPy=GetPy&GetPyChar(mid(Str,i,1))
next
endfunction

FunctionGetURL(url)
SetRetrieval=CreateObject("Microsoft.XMLHTTP")
WithRetrieval
.Open"GET",url,False
.Send
GetURL=bytes2bstr(.responsebody)
iflen(.responsebody)<100then
response.write"获取远程文件<ahref="&url&"target=_blank>"&url&"</a>失败。"
response.write"<metahttp-equiv=""refresh""content=""0;URL=getid.asp?id="&gourl1&""">"
response.end
endif

EndWith
SetRetrieval=Nothing
EndFunction
functionbytes2bstr(vin)
strreturn=""
fori=1tolenb(vin)
thischarcode=ascb(midb(vin,i,1))
ifthischarcode<&h80then
strreturn=strreturn&chr(thischarcode)
else
nextcharcode=ascb(midb(vin,i+1,1))
strreturn=strreturn&chr(clng(thischarcode)*&h100+cint(nextcharcode))
i=i+1
endif
next
bytes2bstr=strreturn
endfunction

FunctionGetKey(HTML,Start,Last)
filearray=split(HTML,Start)
filearray2=split(filearray(1),Last)
GetKey=filearray2(0)
EndFunction


'------------------------------------
FunctionSaveRemoteFile(s_LocalFileName,s_RemoteFileUrl)
DimAds,Retrieval,GetRemoteData
DimbError
bError=False
SaveRemoteFile=False
OnErrorResumeNext
SetRetrieval=Server.CreateObject("Msxml2.ServerXMLHTTP")
WithRetrieval
.Open"GET",s_RemoteFileUrl,False
.Send
If.Status=200Then
GetRemoteData=.ResponseBody
Else
bError=True
EndIf
EndWith
SetRetrieval=Nothing

IfNotbErrorThen
SetAds=Server.CreateObject("Adodb.Stream")
WithAds
.Type=1
.Open
.WriteGetRemoteData
.SaveToFileServer.MapPath(s_LocalFileName),2
.Cancel()
.Close()
EndWith
SetAds=nothing
EndIf

IfErr.Number=0AndNotbErrorThen
SaveRemoteFile=True
Else
Err.Clear
EndIf
EndFunction

%>



<%
flashId=Request("Id")

Url="http://
Rs.Close
SetRs=Nothing
conn.close
setconn=nothing
%>
<%
dimgourl
gourl=flashid+1
response.write"<metahttp-equiv=""refresh""content=""0;URL=getid.asp?id="&gourl&"&overid="&request("overid")&"&download="&request("download")&""">"
%>

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章