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 に答える