判断文件是否存在 Code 1public bool webFile(string FileUrl) 2 { 3 int iStatus = 0; 4 try 5 { 6 MSXML2.XMLHTTPClass xmlHTTP = new MSXML2.XMLHTTPClass(); 7 xmlHTTP.open("Get", FileUrl, false, null, null); 8 xmlHTTP.send(""); 9 iStatus = xmlHTTP.status;10 }11 catch12 {13 }14 return iStatus == 200 || iStatus == 0;15 } 转载于:https://www.cnblogs.com/lfzwenzhu/archive/2009/07/08/1519171.html