110,567
社区成员
发帖
与我相关
我的任务
分享
string text = File.ReadAllText("test.xml").Replace("\r\n", "");
text = Regex.Replace(text, @"<!-- *.* -->", "", RegexOptions.IgnoreCase);
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(text);
XDocument xmlDoc = null;
using (StreamReader oReader = new StreamReader(inFileName, Encoding.GetEncoding("ISO-8859-1"))) {
xmlDoc = XDocument.Load(oReader);
}
具体信息可以参考下面的链接:
http://forums.asp.net/t/1775717.aspx/