我是vbscript的新手。我得到的錯誤「聲明預計」在vbscript
宣言預計get_html
在我的代碼的底部。我實際上是試圖爲變量get_html
聲明一個值(這是一個url)。我該如何解決這個問題?
Module Module1
Sub Main()
End Sub
Sub get_html(ByVal up_http, ByVal down_http)
Dim xmlhttp : xmlhttp = CreateObject("msxml2.xmlhttp.3.0")
xmlhttp.open("get", up_http, False)
xmlhttp.send()
Dim fso : fso = CreateObject("scripting.filesystemobject")
Dim newfile : newfile = fso.createtextfile(down_http, True)
newfile.write(xmlhttp.responseText)
newfile.close()
newfile = Nothing
xmlhttp = Nothing
End Sub
get_html _"http://www.somwwebsite.com", _"c:\downloads\website.html"
End Module
我得到這個錯誤不能使用括號,當調用一個Sub,我該怎麼做來解決它,請幫助我是一個初學者 – user1086978 2012-02-20 07:40:24
'代碼'Sub_proc get_html(ByVal up_http,ByVal down_http)是這樣的? – user1086978 2012-02-20 09:28:16
它只是「調用子」語法示例,而「sub_proc」只是一個示例子名。 – 2012-02-20 23:57:39