示例#1
0
 public FormSettings(GVSettings s)
 {
     InitializeComponent();
     settings        = s;
     tbHostname.Text = settings.Hostname.Trim();
     tbUsername.Text = settings.Username.Trim();
     tbPassword.Text = settings.Password;
 }
示例#2
0
        private void LoadSettings()
        {
            if (!File.Exists(Env.SettingsFile))
            {
                SaveSettings();
            }

            // Deserialize settings from file
            using (StreamReader sr = new StreamReader(Env.SettingsFile))
            {
                XmlSerializer x = new XmlSerializer(settings.GetType());
                settings = x.Deserialize(sr) as GVSettings;
            }
        }