1

我认为这可能与外部文件有关,但我收到错误消息Path not found,不知道为什么。代码如下。

<%

Dim fs
set fs = Server.CreateObject("Scripting.FileSystemObject")
fs.CopyFile "http://domain.com/file.xml","softvoyage.xml"
set fs = Nothing

%>DONE.
4

2 回答 2

3

FileSystemObject 仅用于本地磁盘文件。试试这个:

<%
    url = "http://www.espn.com/main.html" 
    set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") 
    xmlhttp.open "GET", url, false 
    xmlhttp.send "" 
    Response.write xmlhttp.responseText 
    set xmlhttp = nothing 
%>

可在http://classicasp.aspfaq.com/general/how-do-i-read-the-contents-of-a-remote-web-page.html找到

于 2010-01-22T19:55:30.827 回答
1

我不相信 CopyFile 方法可以从 http 源复制文件。我见过的关于 source 参数的唯一示例是本地文件系统上的文件:

FileSystemObject.CopyFile "c:\srcFolder\srcFile.txt", "c:\destFolder\"

如果您需要保存来自 http 请求的数据,请查看IXMLHTTPRequest 对象

于 2010-01-22T20:05:52.467 回答