1
如何從網站獲取xml文件並將其保存在PC上。 用C#什麼是簡單的方法?從網站獲取Xml文件
如何從網站獲取xml文件並將其保存在PC上。 用C#什麼是簡單的方法?從網站獲取Xml文件
使用WebClient從.NET庫:
WebClient Client = new WebClient();
Client.DownloadFile("http://foo.bar", @"C:\filename.xml");
@drorhan:這意味着你可能已經使用了不正確的URL。你是否通過代理使用互聯網?這也可能有所作爲。有關HTTP錯誤代碼,請參閱此處:http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html – csl 2009-10-08 12:34:10