// Loads in the settings from the file, returning success/failure public static bool Load() { try { Inner = new Dictionary <string, object>(); using (Shared.TextReader In = new Shared.TextReader(File.OpenRead(Path))) { while (true) { string Key = In.ReadString(); string Value = In.ReadString(); if (Key == null || Value == null) { break; } Inner.Add(Key, Value); } } } catch { return(false); } return(true); }
// Loads in the settings from the file public static void Load() { try { using (Shared.TextReader In = new Shared.TextReader(File.OpenRead(Path))) { // Read a key on one line string Key = In.ReadString(); // Set the appropriate variable depending on the key if (Key == "DatabasePath") DatabasePath = In.ReadString(); else if (Key == "Port") Port = In.ReadInt32(); } } catch { } }
// Loads in the settings from the file public static void Load() { try { using (Shared.TextReader In = new Shared.TextReader(File.OpenRead(Path))) { // Read a key on one line string Key = In.ReadString(); // Set the appropriate variable depending on the key if (Key == "DatabasePath") { DatabasePath = In.ReadString(); } else if (Key == "Port") { Port = In.ReadInt32(); } } } catch { } }