private void Form1_Shown(object sender, EventArgs e) { textBox1.Text = GetAppConfig("ServerIP") == null ? textBox1.Text : GetAppConfig("ServerIP"); textBox2.Text = GetAppConfig("Acction") == null ? textBox2.Text : GetAppConfig("Acction"); textBox3.Text = GetAppConfig("Password") == null ? textBox3.Text : GetAppConfig("Password"); db = new DataChanged(this); db.ConnStatus += ConnectionStatus; }
private void Form3_Shown(object sender, EventArgs e) { textBox8.Text = GetAppConfig("ServerIP") == null ? textBox1.Text : GetAppConfig("ServerIP"); textBox7.Text = GetAppConfig("Acction") == null ? textBox2.Text : GetAppConfig("Acction"); textBox6.Text = GetAppConfig("Password") == null ? textBox3.Text : GetAppConfig("Password"); db = new DataChanged(this); db.ConnStatus += ConnectionStatus; Data = new List <dj_item>(); if (File.Exists(Application.StartupPath + "\\item.txt")) { Task.Run(() => { Read(Application.StartupPath + "\\item.txt"); }); } else { MessageBox.Show("未找到item.txt物品信息文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public Form2(DataChanged _db) { InitializeComponent(); db = _db; }