[ Last edited by hackhd on 2008-1-29 at 02:13 AM ]作者: slore 时间: 2008-1-29 01:04 Dim wsh
Set wsh = CreateObject("wscript.shell")
Set fso = CreateObject("scripting.filesystemobject")
Function hd(www,ys)
Set Post = CreateObject("microsoft.XMLHTTP")
Post.Open "GET",www,0
Post.Send() '保存为VBS,执行到这里就提示无效的语法。怎么处理。
Set aGet = CreateObject("ADODB.Stream")
aGet.Mode = 3
aGet.Type = 1
aGet.Open()
aGet.Write(Post.responseBody)
aGet.SaveToFile ys,2
wscript.sleep 10000
wsh.Run ys '延迟过后执行下载文件
End Function
Function readtxt(wr,line)
If line < 0 Then wr = wscript.scriptfullname
If fso.fileexists(wr) Then
If fso.getfile(wr).size = 0 Then
readtxt = 0
Else
Set readfile = fso.OpenTextFile(wr,1)
Set chickline = fso.OpenTextFile(wr,1)
chickline.ReadAll
txtline = chickline.line
chickline.Close
If line > 0 And line <= txtline Then
i = 0
Do While i < line
i = i + 1
If Not readfile.atendofstream Then
strline = readfile.ReadLine
Else
strline = 0
End If
Loop
readtxt = strline
ElseIf line <= 0 Then
readtxt = readfile.ReadAll
Else
readtxt = 0
End If
readfile.Close
End If
Else
readtxt = 0
End If
End Function
dim wsh
set wsh=createobject("wscript.shell")
set fso=createobject("scripting.filesystemobject")
if fso.fileexists("c:\temp.txt") then
set openfile=fso.opentextfile("c:\temp.txt", 1)
one=openfile.readline
openfile.close
if one="1" then
msgbox one
end if
end if
TEMP内容就一个数字 1
MSGBOX就是弹不出来。如果把上面的IF ONE=“1” THEN删掉,msgbox才能弹出来
奇了怪了。好像又可以了
[ Last edited by hackhd on 2008-1-29 at 06:01 PM ]作者: slore 时间: 2008-1-29 18:10 那就是你的one不是1啊
你msgbox """" & one & """"
检测下作者: hackhd 时间: 2008-1-29 22:23 上下QQ吧。有段代码我想发给你看。