0

我想使用 C# 将 Xml Url 内容保存到文本文件中我试过这段代码

System.Xml.XmlTextReader _XmlTextReader = new System.Xml.XmlTextReader("http://www.w3schools.com/php/links.xml");
        string_xmlContent =_XmlTextReader.Readinnerxml();
        System.IO.File.WriteAllText("C:\users\vaio\desktop\new folder");

但它没有用**

PS:抱歉我的英文不太好

4

1 回答 1

0

尝试这个。

XmlDocument document = new XmlDocument();
document.Load("http://www.w3schools.com/php/links.xml");

File.WriteAllText("c:\\links.xml", document.InnerXml);
于 2013-09-13T23:44:08.933 回答