Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- INI Parser
- */
- [DllImport("kernel32")]
- private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
- [DllImport("kernel32")]
- private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
- public static void IniWriteValue(string filePath, string section, string key, string value, string comment)
- {
- var str = string.Format(" {0}", value);
- if (comment != null) str += string.Format(" {0} {1} ", CommentDelimiter, comment);
- WritePrivateProfileString(section, key, str, filePath);
- }
- /*
- Config Getter/Setter
- */
- public static string Name
- {
- get { return INI.IniReadValue(Files.INI.Config, "client", "name"); }
- set {INI.IniWriteValue(Files.INI.Config, "client", "name", value,"Choose a name for your player, must be less than 16 characters"); }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement