public formConnect() { InitializeComponent(); userSettings = UserSettings.Load(); _serverName = ""; new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst); }
public static void Save(UserSettings settings) { string settingsFile = Path.Combine(CreateSettingsFolder(), "hMailAdmin.exe.config"); XmlTextWriter writer = new XmlTextWriter(settingsFile, Encoding.UTF8); try { writer.Formatting = Formatting.Indented; XmlSerializer xmlSerializer = new XmlSerializer(typeof(UserSettings)); xmlSerializer.Serialize(writer, settings); } catch (Exception) { } finally { writer.Close(); } }
private static UserSettings CreateDefault() { UserSettings retVal = new UserSettings(); Server server = new Server(); server.hostName = "localhost"; server.userName = "******"; server.encryptedPassword = ""; retVal.ServerConnections.List.Add(server); return retVal; }