public static XmppClientForm GetInstance() { lock (objLock) { if (ClientInstance == null) { ClientInstance = new XmppClientForm(); } return(ClientInstance); } }
private void login( ) { button1.Enabled = false; XmppClientForm.Uinfo user = new XmppClientForm.Uinfo(); user.Unumber = textBox1.Text; user.Passwd = textBox2.Text; client = XmppClientForm.GetInstance(); client.Text = ">>>" + textBox1.Text + "<<<" + client.Text; client.UserInfo = user; client.AutoSend = AutoSend; client.Login(); client.xmppClient.OnLogin += new agsXMPP.ObjectHandler(onlogin); toolStripStatusLabel1.Text = "登录中,请稍等...."; timer1.Enabled = true; }