<$$
Server.ScriptTimeOut=99999
for x=1 to 2500000
Set xPost = CreateObject("Microsoft.XMLHTTP")
xPost.Open "GET","http://download.cmfu.com/pda/"&x&".txt",False
xPost.Send()
Set sGet = CreateObject("ADODB.Stream")
sGet.Mode = 3
sGet.Type = 1
sGet.Open()
sGet.Write(xPost.responseBody)
sGet.SaveToFile Server.MapPath(""&x&".txt"),2
set sGet = nothing
set sPOST = nothing
next
$$>
------- 将要增加的功能! 1.将按照下载的txt的第一行中的关键词做为文本名. 2.将下载的txt文本中的某些词替换掉.
由于本人比较喜欢长一点的书。。所以。。。要修改一下。。。只下载大于500k的书吧。。
【code】
<%
Function ShowFileSize(filespec)
file = Server.MapPath(filespec)
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(file) Then
Set f = fso.GetFile(file)
intSizeB = f.Size
intSizeK = Int((intSizeB/1024) + .5)
If intSizeK = 0 Then intSizeK = 1
ShowFileSize = intSizeK
Else
ShowFileSize = "File Doesn't Exist"
End If
Set fso = Nothing
End Function
Function deletefile(filespec)
file = Server.MapPath(filespec)
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(file) Then
fso.DeleteFile file, True
End If
Set fso = Nothing
End Function
Server.ScriptTimeOut=99999999
for x=1 to 2500000
Set xPost = CreateObject("Microsoft.XMLHTTP")
xPost.Open "GET",http://download.cmfu.com/pda/"&x&".txt,False
xPost.Send()
Set sGet = CreateObject("ADODB.Stream")
sGet.Mode = 3
sGet.Type = 1
sGet.Open()
sGet.Write (xPost.responseBody)
sGet.SaveToFile Server.MapPath("book\"&x&".htm"),2
dim s
s=ShowFileSize("book\"&x&".htm")
if s<=3 then
deletefile("book\"&x&".htm")
response.write "已删除 "&"book\"&x&".htm"
end if
response.write "<br>"
set sGet = nothing
set sPOST = nothing
'
'
next
%>
【code】存为x.asp 在此目录建立一个叫book的。。。然后就可以去睡觉了。。。