SimpleConfigurationManager.SConfigManager.ReadConfigFromFile C# (CSharp) 메소드

ReadConfigFromFile() 공개 정적인 메소드

Reads the configuration string from file and returns it.
This method is handling only reading operation and casting to XML. No XML validation is done here.
public static ReadConfigFromFile ( string path ) : string
path string Path to the file with configuration.
리턴 string
        public static string ReadConfigFromFile(string path)
        {
            XmlDocument content = new XmlDocument();

            try
            {
                content.Load(path);
            }
            catch (Exception ex)
            {
                Exception exception = new Exception("Cannot load XML from file.", ex);
                throw exception;
            }

            return content.InnerXml;
        }