示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
        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 { }
        }
示例#4
0
 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);
 }