コード例 #1
0
        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));
        }
コード例 #2
0
 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);
 }