private void WSRestApiAppMainForm_FormClosed(object sender, FormClosedEventArgs e) { Pref p = new Pref(); p.WSServer = tbUri.Text; p.UserName = tbUserName.Text; p.Password = tbPassword.Text; File.WriteAllText(PrefPath, JsonConvert.SerializeObject(p, Formatting.Indented)); }
private void WSRestApiAppMainForm_Load(object sender, EventArgs e) { if (File.Exists(PrefPath)) { Pref p = JsonConvert.DeserializeObject <Pref>(File.ReadAllText(PrefPath)); tbUri.Text = p.WSServer; tbUserName.Text = p.UserName; tbPassword.Text = p.Password; } WSUriTextChanged(null, null); }