GetPrivateProfileString() private method

private GetPrivateProfileString ( string lpAppName, string lpKeyName, string lpDefault, System lpReturnedString, int nSize, string lpFilePath ) : int
lpAppName string
lpKeyName string
lpDefault string
lpReturnedString System
nSize int
lpFilePath string
return int
Beispiel #1
0
        /// <summary>
        /// Read data value from the ini file
        /// </summary>
        public static ConfigValue Read(string Key)
        {
            CheckDefaultConfig();

            StringBuilder temp = new StringBuilder(255);

            WinAPI.GetPrivateProfileString(configSection, Key, null, temp, 255, configPath);

            if ((string.IsNullOrWhiteSpace(temp.ToString()) && !string.IsNullOrWhiteSpace(Default[Key])) ||
                ((Key == "aLang" || Key == "eLang") && !configLangs.Contains(temp.ToString())))
            {
                Write(Key, Default[Key]);
                return(new ConfigValue(Default[Key]));
            }
            else
            {
                return(new ConfigValue(temp.ToString()));
            }
        }