SimpleConfigurationManager.SConfigManager.ReadConfigFromFile C# (CSharp) Method

ReadConfigFromFile() public static method

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.
return 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;
        }