private void Login() { try { Window1 LoginWin = new Window1(); LoginWin.ShowDialog(); username = LoginWin.GetName(); InstanceContext ins = new InstanceContext(this); proxy = new QQProxy(ins); IAsyncResult iar = proxy.BeginJoin(username, new AsyncCallback(OnEndJoin), null); } catch (Exception e) { throw e; } }