ALFA.SystemInfo.GetNWNX4IniString C# (CSharp) Метод

GetNWNX4IniString() публичный статический Метод

Read an INI file setting from a NWNX4 plugin INI. The INI must follow the Windows INI format of [Sections] with Setting=Value . Note that some plugins, such as xp_mysql, do NOT use this format and cannot use this function.
public static GetNWNX4IniString ( string IniFileName, string SectionName, string SettingName, string DefaultValue, int MaxValueSize ) : string
IniFileName string Supplies the INI file name, such as /// "AuroraServerVault.ini". The file name should not include a path /// component.
SectionName string Supplies the section name, such as /// "Settings".
SettingName string Supplies the setting name, such as /// "LocalServerVaultPath".
DefaultValue string Supplies the default value to return if /// the setting didn't exist.
MaxValueSize int Supplies the maximum length of the /// string value to read from the INI file. This must be at least as /// long as the DefaultValue length.
Результат string
        public static string GetNWNX4IniString(string IniFileName, string SectionName, string SettingName, string DefaultValue, int MaxValueSize)
        {
            if (MaxValueSize < DefaultValue.Length + 1)
                throw new ApplicationException("MaxValueLength is shorter than the default value length.");

            StringBuilder ReturnedString = new StringBuilder(MaxValueSize);

            GetPrivateProfileStringW(
                SectionName,
                SettingName,
                DefaultValue,
                ReturnedString,
                (uint)MaxValueSize,
                GetNWNX4InstallationDirectory() + IniFileName);

            return ReturnedString.ToString();
        }

Same methods

SystemInfo::GetNWNX4IniString ( string IniFileName, string SectionName, string SettingName, string DefaultValue ) : string