private void ClearConfiguration() { Configuration config = new Configuration(); config.Username = String.Empty; config.Password = String.Empty; config.Account = String.Empty; config.SSL = false; config.ProxyUrl = string.Empty; Configuration.Serialize(CONFIG, config); }
private void SaveConfiguration() { Configuration config = new Configuration(); config.Username = username.Text; config.Password = password.Text; config.Account = account.Text; config.SSL = ssl.Checked; config.ProxyUrl = proxyUrl.Text.Trim(); Configuration.Serialize(CONFIG, config); }
public static void Serialize(string file, Configuration c) { try { System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(c.GetType()); StreamWriter writer = File.CreateText(file); xs.Serialize(writer, c); writer.Flush(); writer.Close(); } catch { } }
private void SaveConfiguration(Configuration config) { config.Username = username.Text; config.Password = password.Text; config.Account = account.Text; config.SSL = ssl.Checked; Configuration.Serialize(CONFIG, config); }