Argentini.Halide.H3Config.GetKeyAsInt64 C# (CSharp) Method

GetKeyAsInt64() public static method

Retrieve the value of an application setting from the Web.config file. Returns the default value if the key is not found.
public static GetKeyAsInt64 ( String keyName, System.Int64 defaultValue ) : System.Int64
keyName String Key name for which a value should be returned.
defaultValue System.Int64 Default value to use if the key is not found.
return System.Int64
        public static Int64 GetKeyAsInt64(String keyName, Int64 defaultValue)
        {
            Int64? value = null;

            if (ConfigurationManager.AppSettings[keyName] != null)
            {
                if (H3Identify.IsPureNumeric(ConfigurationManager.AppSettings[keyName].ToString()))
                {
                    value = Convert.ToInt64(ConfigurationManager.AppSettings[keyName]);
                }
            }

            if (value == null)
            {
                value = defaultValue;
            }

            return (Int64)value;
        }

Same methods

H3Config::GetKeyAsInt64 ( String keyName, System.Int64 defaultValue, String sectionName ) : System.Int64
H3Config::GetKeyAsInt64 ( String keyName, String defaultValue ) : System.Int64
H3Config::GetKeyAsInt64 ( String keyName, String defaultValue, String sectionName ) : System.Int64
H3Config::GetKeyAsInt64 ( String keyName ) : Int64?