private void Form1_Load(object sender, EventArgs e) { Hashtable properties = PropertiesUtil.Load("./cfg.txt"); if (properties != null) { this.username.Text = (string)properties["username"]; this.password.Text = (string)properties["password"]; } }
private Hashtable SaveProperties() { string file = @"./cfg.txt"; Hashtable properties = new Hashtable { { "username", this.username.Text }, { "password", this.password.Text } }; PropertiesUtil.Save(file, properties); return(properties); }