从网站获取Xml文件

Orh*_*nar 1 .net c# xml webclient

如何从网站获取xml文件并将其保存在PC上.C#的简单方法是什么?

csl*_*csl 5

使用.NET库中的WebClient:

WebClient Client = new WebClient();
Client.DownloadFile("http://foo.bar", @"C:\filename.xml");
Run Code Online (Sandbox Code Playgroud)