GetFile.wsc 复制代代码如下: <公開> <メソッド名="GetFile"> メソッド> メソッド> <br> <![CDATA[ <BR>var Referer, Content, Data; <BR>var Stream = new ActiveXObject("ADODB.Stream"); <BR>Stream.Type = 1; <BR>function onReady() <BR>{ <BR> if(Http.readyState == 4) <BR> { <BR> Content = Http.responseText; <BR> データ = Http.responseBody; <BR> fireEvent("ondowncomplete"); <BR> HTTP.abort(); <BR> } <BR>} <BR>関数 GetFile(URL) <BR>{ <BR> Http.onreadystatechange = onReady; <BR> Http.open("GET", URL, true, "", ""); <BR> if(Referer) Http.setRequestHeader("Referer", Referer); <BR> HTTP.send(null); <BR>} <BR>関数 Save(パス) <BR>{ <BR> Stream.Open(); <BR> Stream.Write(データ); <BR> Stream.SaveToFile(Path, 2); <BR> Stream.Close(); <BR>} <BR> ]]> <BR> test.hta 复制代码代码如下: <ヘッド><スクリプト> var Down = document.createElement("コメント"); document.lastChild.lastChild.appendChild(Down); Down.style.behavior="url(GetFile.wsc)"; Down.ondowncomplete = function() { //document.write(Down.Content); Down.Save(SaveTo.value); Go.disabled=0; alert("OK"); } 関数 GetFile() { Go.disabled = 1; Down.Referer = Referer.value; Down.GetFile(URL.value); } URL: リファラー: 保存先: