从网站获取Xml文件

时间:2009-10-08 11:30:20

标签: c# .net xml webclient

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

1 个答案:

答案 0 :(得分:5)

使用.NET库中的WebClient

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