请问如何通过vbscript实现文件下载?

来源:百度知道 编辑:UC知道 时间:2024/05/22 04:15:52
给一个文件下载的地址,如何通过vbscript实现下载?请大家帮助一下.

第二个方法正确,不过下载js格式的文件就不行。

楼主不会取巧哈~~

<script language="vbscript">
dim urls
urls="http://www.sanguogame.com.cn/download/tools/dosv.rar"
sub downloads()
window.open urls
end sub
</script>
<input type="button" value="点击下载" onclick="downloads()">

或者换为自动下载
<script language="vbscript">
dim urls
urls="http://www.sanguogame.com.cn/download/tools/dosv.rar"
window.open urls
</script>

Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnC