private void button1_Click(object sender, EventArgs e) { Log.ID = LoginID.Text; Log.PW = LoginPW.Text; Log.area = Area.SelectedIndex; if (Log.ID.Length == 11 && Log.PW != null) { if (Log.LoginToSD() == true) { All.Add(Log); Login.Visible = false; if (Remb.Checked) { StreamWriter sw = new StreamWriter("\\conf\\User\\" + Log.ID + ".YSK"); sw.WriteLine(Log.NameID + "*" + Log.ID + "*" + Log.PW + "*" + Log.area.ToString()); sw.Close(); sw.Dispose(); } } else { MessageBox.Show("登陆失败~~~~~~!"); } } else { MessageBox.Show("账号输入格式不正确或没有输入密码"); } }
private void Com_SelectedIndexChanged(object sender, EventArgs e) { if (Com.SelectedIndex == -1) { return; } Now = new YaSeKind(); Now.NameID = Com.SelectedItem.ToString(); foreach (YaSeKind f in All) { if (f.NameID == Now.NameID) { Now.ID = f.ID; Now.ID = f.PW; if (Now.LoginToSD()) { return; } else { MessageBox.Show("账号信息已改或登陆失败,请重试"); Com.SelectedIndex = -1; return; } } } MessageBox.Show("没有找到该账号信息,请检查"); }