The client determines if a network file exists

xiaoxiao2021-03-06  82

Function Test (URL) {var Xmlhttp = New ActiveXObject ("Microsoft.xmlhttp"); XMLHttp.Open ("Get", URL, FALSE); XMLHttp.send (); if (Xmlhttp.status == 200 || XMLHTTP. Status == 0) Return True;}

Function Test (URL) {var Xmlhttp = New ActiveXObject ("Microsoft.xmlhttp"); try {xmlhttp.open ("get", url, false; xmlhttp.send (); if (xmlhttp.status == 200 || XMLHTTP.STATUS == 0) Return true; Else Return false;} catch (e) {returnaf false;}}

function DownURL (strRemoteURL, strLocalURL) {try {var xmlHTTP = new ActiveXObject ( "Microsoft.XMLHTTP"); xmlHTTP.open ( "Get", strRemoteURL, false); xmlHTTP.send (); var adodbStream = new ActiveXObject ( "ADODB .Stream "); adodbStream.Type = 1; // 1 = adTypeBinary adodbStream.Open (); adodbStream.write (xmlHTTP.responseBody); adodbStream.SaveToFile (strLocalURL, 2); adodbStream.Close (); adodbStream = null; Xmlhttp = null;} catch (e) {window.confirm ("Download URL error!");} //window.confirm ("Download completion.");}

转载请注明原文地址:https://www.9cbs.com/read-121672.html

New Post(0)