读取XML

    public sealed class ConfigManger
{
public XDocument XmlDocs { set; get; } string path = @"{0}\Configuration\Server\{1}";
public ConfigManger()
{
LoadFiles();
} public static ConfigManger Instance
{
get
{
return ConfigCreateXML.Singleton;
}
} public class ConfigCreateXML
{ static ConfigCreateXML() { } internal static readonly ConfigManger Singleton = new ConfigManger();
} void LoadFiles()
{
string filePath = string.Format(path, AppDomain.CurrentDomain.BaseDirectory, "ServerPath.config");
if (XmlDocs == null)
{
XmlDocs = XDocument.Load(filePath);
}
}
}
上一篇:转: DNS 原理入门 (from 阮一峰)


下一篇:yii2发送邮件教程