protected override void btnOk_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbAddress.Text) == false) { if (m_Acc != null) { if (tbName.Text == m_Acc.ToString()) { if (m_Acc != null) { m_accName = m_Acc.ToString(); m_Acc.SaveKey(null); m_Acc = null; } DialogResult = DialogResult.OK; Close(); } else { MessageBox.Show("Name is invalid. You should regenerate address", Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { DialogResult = DialogResult.Cancel; Close(); } } else { MessageBox.Show("Address is empty", Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void button2_Click(object sender, RoutedEventArgs e) { mke = new SMSAccount("ALICE"); mke.AddressBook = addressbook; string err = mke.LoadKey(null); if (string.IsNullOrEmpty(err) == false) { mke.GenerateKey(); err = mke.SaveKey(null); } if (string.IsNullOrEmpty(err) == false) { MessageBox.Show(err); } client = new SMSNet(mke); client.Connect("127.0.0.1", 5555); }