标签:bsp text mvm www base using rsn context conf
XmlDocument xmlDoc = new XmlDocument();
string filePath = Path.Combine(AppContext.BaseDirectory, "Configuration", sDir, string.Format("{0}.xml", sXmlName));
StringBuilder builder = new StringBuilder();
using (FileStream fs = File.Open(filePath, FileMode.OpenOrCreate))
{
using (StreamReader sr = new StreamReader(fs, Encoding.UTF8))
{
builder.Append(sr.ReadToEnd());
}
}
if (builder.Length > 0)
xmlDoc.LoadXml(builder.ToString()); //
return xmlDoc;
注意:
xmldoc.load可以加载文件,比如:xmldoc.load("c:\\a.xml");
而xmldoc.loadXML是加载xml格式的字符串,比如:xmldoc.loadXML("<aab>aaa</aab>")
标签:bsp text mvm www base using rsn context conf
原文地址:http://www.cnblogs.com/DSC1991/p/7911215.html