/// <summary> /// 指定したセクションのキーに設定されているstring値を取得 /// </summary> /// <param name="section"></param> /// <param name="key"></param> /// <param name="def"></param> /// <param name="filePath"></param> /// <returns></returns> public static string GetString(string section, string key, string def, string filePath) { StringBuilder buffer = new StringBuilder(2048); PrivateProfile.ReadString(section, key, def, buffer, 2048, filePath); return(buffer.ToString()); }
/// <summary> /// 指定したセクションのキーに設定されているint値を取得 /// </summary> /// <param name="section"></param> /// <param name="key"></param> /// <param name="def"></param> /// <param name="filePath"></param> /// <returns></returns> public static int GetInt(string section, string key, int def, string filePath) { return((int)PrivateProfile.ReadInt(section, key, def, filePath)); }
/// <summary> /// 指定したセクションのキーに値を設定 /// </summary> /// <param name="section"></param> /// <param name="key"></param> /// <param name="value"></param> /// <param name="filePath"></param> public static void SetValue(string section, string key, object value, string filePath) { PrivateProfile.Write(section, key, value.ToString(), filePath); }