private void LoginButtton_Click(object sender, EventArgs e) { baseInfoDataSet = OMWorkBench.DeserializeDataSet(dataAgent.GetBaseInfo()); selfInfoDataSet = dataAgent.Login(AgentIDTextBox.Text, userNameTextBox.Text, passWordTextBox.Text); if (selfInfoDataSet != null) { this.DialogResult = DialogResult.OK; if (SaveLoginInfo.Checked) { XmlDocument doc = new XmlDocument(); XmlElement docEle = doc.CreateElement("docEle"); docEle.SetAttribute("agentName", AgentIDTextBox.Text); docEle.SetAttribute("userName", userNameTextBox.Text); docEle.SetAttribute("passWord", passWordTextBox.Text); doc.AppendChild(docEle); doc.Save(@"c:\om.xml"); } this.Close(); } else { MessageBox.Show("登录失败!"); } }