我要求功能是用VBS打开E:\1.TXT内的网址并设置1s钟切换一下不断循环。我在网上找了一下。如下代码有点类似,只不过有点区别,他是要求选择打开TXT的,而我要的是指定的E:\1.TXT。还有就是下面这段代码在WIN7上打不开,只能在XP里打开;- Set objDialog = CreateObject("UserAccounts.CommonDialog")
- objDialog.Filter = "所有文件|*.*"
- objDialog.InitialDir = "E:\"
- objDialog.ShowOpen
- allurl = CreateObject("scripting.filesystemobject").opentextfile(objDialog.FileName).readall
- set objDialog = nothing
- url = split(allurl,vbcrlf)
- set ie=createobject("internetexplorer.application")
- ie.visible=true
- do
- for i = 0 to ubound(url)
- ie.navigate url(i)
- While ie.busy Or ie.readystate <> 4
- Wend
- Wscript.Sleep 1000
- next
- loop
- set ie = nothing
复制代码 哪位大侠帮我改一下,感激不尽啊! |