public void ExchangeDone(LoginClient client) { lock (Clients) Clients.Remove(client); OnLogin?.Invoke(client); }
public async Task LoginAsync(string login, string password, string loginPath) { var loginCredentials = new LoginCredentials(login, password); var loginJson = JsonConvert.SerializeObject(loginCredentials); var response = await Client.PostJsonAsync(loginPath, new StringContent(loginJson)); if (response.IsSuccessStatusCode) { var jwtJson = await response.Content.ReadAsStringAsync(); var jwt = JsonConvert.DeserializeObject <Jwt>(jwtJson); Token = jwt.Token; AutomaticLogout(jwt.Expires); IsLoggedIn = true; OnLogin?.Invoke(this, EventArgs.Empty); return; } if (response.StatusCode.Equals(HttpStatusCode.BadRequest)) { throw new ClientException(ErrorCodes.InvalidLoginCredentials); } }
public async void Login() { JobLoginAsync j = new JobLoginAsync(); j.username = emailField.text; j.password = passwordField.text; j.OnStart += () => { loginErrorText.gameObject.SetActive(false); }; j.OnError += (e) => { if (e == "auth") { loginErrorText.text = "Login failed, please try again"; loginErrorText.gameObject.SetActive(true); } }; j.OnResult += (SDKLoginResult result) => { PlayerPrefs.SetString("login", j.username); PlayerPrefs.SetString("password", j.password); PlayerPrefs.SetString("token", result.token); PlayerPrefs.SetString("server", serverField.text); m_Sdk.developerToken = result.token; loginErrorText.gameObject.SetActive(false); FadeOut(); OnLogin?.Invoke(); }; await j.RunJobAsync(); }
private void PostLoginEvent() { if (!String.IsNullOrWhiteSpace(Txt_Username.Text) && !String.IsNullOrEmpty(Txt_Password.Password)) { Txt_loginFailure.Visibility = Visibility.Hidden; UserLoginEventArgs args = new UserLoginEventArgs() { Username = Txt_Username.Text, Password = Txt_Password.Password, AutomaticLogin = Chk_AutoLogin.IsChecked == true, RememberPassword = Chk_RememberPassword.IsChecked == true }; OnLogin?.Invoke(this, args); loginInfo.Message = "正在登录..."; } else if (String.IsNullOrWhiteSpace(Txt_Username.Text)) { loginInfo.Message = "请输入用户名!"; loginInfo.IsShown = true; } else if (String.IsNullOrEmpty(Txt_Password.Password)) { loginInfo.Message = "请输入密码!"; loginInfo.IsShown = true; } }
void LoginInvoke() { _timer.Change((long)Timeouts.Login, (long)Timeouts.Login); OnLogin?.Invoke(this, new AgentStateEventArgs { Mode = _mode }, _monitorId); }
private void btnLogIn_Click(object sender, RoutedEventArgs e) { SetButtonState(false); waitind.Visibility = Visibility.Visible; //show login animation LoginEventArgs arg = new LoginEventArgs(); foreach (BaseEdit x in logincontrols.Keys) { LoginParameter tmp = logincontrols[x]; if (tmp.Required && x.EditValue == null) { //set required label lciError.Visibility = Visibility.Visible; waitind.Visibility = Visibility.Hidden; lblError.Content = tmp.Name + " is required."; SetButtonState(true); return; } arg.Values.Add(new LoginParamValue { Param = tmp, Value = x.EditValue?.ToString() ?? "" }); if (tmp.ClearAfterEnter) { x.EditValue = null; } } lciError.Visibility = Visibility.Hidden; OnLogin?.Invoke(this, arg); }
public void Login(LoginRequest loginRequest, OnLogin loginCallback, OnFailure failureCallback) { LoginResponseHandler loginResponseHandler = new LoginResponseHandler(); try { string sessionId; Response response = this._httpInvoker.Invoke(this._baseUri, (IRequest)loginRequest, this._xmlParser, (Handler)loginResponseHandler, out sessionId); if (response.IsOk) { if (loginResponseHandler.IsOk) { loginCallback((ISession) new Session(loginResponseHandler.AccountDetails, this._baseUri, this._httpInvoker, this._xmlParser, sessionId, true)); } else { failureCallback(new FailureResponse(false, loginResponseHandler.FailureType, loginResponseHandler.Message, (Exception)null)); } } else { failureCallback(new FailureResponse(true, "HttpStatus: " + (object)response.Status + ", for: " + this._baseUri + loginRequest.Uri)); } } catch (Exception ex) { failureCallback(new FailureResponse(ex, "URI: " + this._baseUri + loginRequest.Uri)); } }
public void SendLoginRequest(string user, string pass, OnLogin onLogin) { if (m_mock) { #if DEBUG_LOG Debug.Log("Mocking auth. Auto logging in with random ID (or forced ID provided if any)"); #endif // DEBUG_LOG string id = m_forceUserID.Length > 0 ? m_forceUserID : System.Guid.NewGuid().ToString(); onLogin(id); return; } m_onLoginCallbacks.Enqueue(new LoginRequest() { User = user, Pass = pass, Callback = onLogin }); if (!m_readyForNextCall) { return; } m_readyForNextCall = false; SendLoginRequest(user, pass); }
/// <summary> /// Se ejecuta cuando el usuario le da click al boton de iniciar sesión /// </summary> private void On_LoginBtn_clicked(object o, EventArgs args) { //obtenemos las entradas var correo = LoginCorreo.Text; var clave = LoginClave.Text; //buscamos por un usuario con ese correo. Usuario user = DomiciliosApp.Instance.Compradores.Find(C => C.Correo == correo); user ??= DomiciliosApp.Instance.Vendedores.Find(V => V.Correo == correo); //si es null es porque no es encuentra ese usuario. if (user == null) { LoginCorreoExp.RevealChild = true; } else { //validamos la clave if (user.Clave == clave) { DomiciliosApp.ClienteActual = user; //llamamos el callback, si existe OnLogin?.Invoke(); } else { LoginClaveExp.RevealChild = true; } } }
private async void LoginClick(object sender, RoutedEventArgs arg) { await Task.Run(() => { m_btnLogin.Dispatcher.Invoke(() => { m_btnLogin.IsEnabled = false; }); m_passwd = m_pwBox.Password; m_ssh = new SshClient(m_ip, m_user, m_passwd); m_ssh.ConnectionInfo.Timeout = TimeSpan.FromSeconds(3); m_scp = new ScpClient(m_ip, m_user, m_passwd); m_scp.ConnectionInfo.Timeout = TimeSpan.FromSeconds(3); try { m_ssh.Connect(); m_scp.Connect(); } catch (Exception e) { MessageBox.Show(e.Message); if (m_ssh.IsConnected) { m_ssh.Disconnect(); } m_btnLogin.Dispatcher.Invoke(() => { m_btnLogin.IsEnabled = true; }); return; } OnLogin?.Invoke(this, arg); }); }
public async void LoginAsync() { IsLoggingIn = true; Regex r = new Regex(@"^(([^<>()[\]\\.,;:\s@\""]+(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$"); if (User.Emailadress != null && User.Password != null && r.IsMatch(User.Emailadress)) { if (await UserService.CheckUser(User as User) is User checkedUser) { Style = ""; OnLogin?.Invoke(checkedUser); } else { User.Password = null; Style = "border-color: red;"; StateHasChanged(); } } else { Style = "border-color: red;"; } IsLoggingIn = false; }
private void InitView() { UsernameInput = new TextField(14, 2, 40, ""); OkButton = new Button(3, 14, "Ok"); CancelButton = new Button(10, 14, "Cancel"); OkButton.Clicked += new Action(() => { var name = UsernameInput.Text.TrimSpace().ToString(); if (!string.IsNullOrEmpty(name)) { OnLogin?.Invoke(name); } }); CancelButton.Clicked += new Action(() => { CancelClicked?.Invoke(); }); Add( new Label(3, 2, "Login: "******"Password: "******"") { Secret = true }, OkButton, CancelButton); }
/// <summary> /// Login to the Lmax Trader platform. The appropriate handler will be called back /// on success or failure. The loginCallback should be the main entry point into /// your trading application. From that point you should add listeners to the /// session, subscribe to resources that you're interested in, e.g. OrderBooks /// and call Start on the <see cref="ISession"/>. /// </summary> /// <param name="loginRequest"> /// A <see cref="LoginRequest"/> that contains your login credentials. /// </param> /// <param name="loginCallback"> /// A <see cref="OnLogin"/> callback, fired when you are successfully logged in. /// </param> /// <param name="failureCallback"> /// A <see cref="OnFailure"/> callback, fired when there is a login failure. /// </param> public void Login(LoginRequest loginRequest, OnLogin loginCallback, OnFailure failureCallback) { LoginResponseHandler handler = new LoginResponseHandler(); try { string sessionId; Response response = _httpInvoker.Invoke(_baseUri, loginRequest, _xmlParser, handler, out sessionId); if (response.IsOk) { if (handler.IsOk) { loginCallback(new Session(handler.AccountDetails, _baseUri, _httpInvoker, _xmlParser, sessionId, true)); } else { failureCallback(new FailureResponse(false, handler.FailureType, handler.Message, null)); } } else { failureCallback(new FailureResponse(true, "HttpStatus: " + response.Status + ", for: " + _baseUri + loginRequest.Uri)); } } catch (Exception e) { failureCallback(new FailureResponse(e, "URI: " + _baseUri + loginRequest.Uri)); } }
private void OnApplicationFocus(bool focus) { if (focus) { //uniWebView.OnClose(); //StartCoroutine(ShowLoading()); isFirstJoin = false; OnLogin onLo = new OnLogin("Login", LoginInfo.Instance().mylogindata.user_id, LoginInfo.Instance().mylogindata.room_id.ToString(), LoginInfo.Instance().mylogindata.choosegame.ToString()); string str = JsonMapper.ToJson(onLo); tcpNet.SendMessage(str); ClearInfo(); StartCoroutine(GetHistory( LoginInfo.Instance().mylogindata.URL + LoginInfo.Instance().mylogindata.winHistory + "game_id=" + LoginInfo.Instance().mylogindata.choosegame )); StartCoroutine(OnReGet ( LoginInfo.Instance().mylogindata.URL + LoginInfo.Instance().mylogindata.newInit + "user_id=" + LoginInfo.Instance().mylogindata.user_id + "&unionuid=" + LoginInfo.Instance().mylogindata.token + "&room_id=" + LoginInfo.Instance().mylogindata.room_id + "&game_id=" + LoginInfo.Instance().mylogindata.choosegame )); } }
public async Task Init(Context context, string userId) { _context = context; _agoraRtmHandler = new AgoraRtmHandler(); _agoraRtmHandler.OnSignalReceived += (signal) => { Log($"Signal received from {signal.RtcPeerId}"); OnSignalReceived?.Invoke(signal); }; _rtmClient = RtmClient.CreateInstance(_context, AgoraTestConstants.AgoraAPI, _agoraRtmHandler); var rtmToken = await AgoraTokenService.GetRtmToken(userId); var loginCallback = new ResultCallback(); loginCallback.OnSuccessAction += (obj) => { UserName = userId; OnLogin?.Invoke(true); Log("Login Success"); }; loginCallback.OnFailureAction += (err) => { OnLogin?.Invoke(false); Log("Login Fail"); }; _rtmClient.Login(rtmToken, userId, loginCallback); }
private void Login() { UserSession userSession = UserSession.GetInstance(); var userName = TBUserName.Text; string password = TBpassword.Text; User user = SearchUser(userName); if (user == null) { lblwarning.Text = @"User name is incorrect."; lblwarning.Show(); } else if (password == null || password == "") { lblwarning.Text = @"Password is empty."; lblwarning.Show(); } else if (userSession.Login(user, password)) { // dashboard if (OnLogin != null) { OnLogin.Invoke(this, new EventArgs()); } lblwarning.Text = @"Correct password."; lblwarning.Show(); } else { lblwarning.Text = @"Incorrect password."; lblwarning.Show(); } }
void OnUser(string packet) { me = JsonConvert.DeserializeObject <Profile>(packet); loggedIn = true; Debug.Log("Logged in as " + me.username); OnLogin?.Invoke(); CallEverythingLoaded(); }
private void Start() { player = FindObjectOfType <Player>(); if (!string.IsNullOrEmpty(player.Id)) { OnLogin?.Invoke(); } }
/// <summary> /// 连接回调 /// </summary> /// <param name="ia"></param> void ConnectCallBack(IAsyncResult ia) { Debug.LogError("服务器连接成功"); OnLogin login = new OnLogin("Login", LoginInfo.Instance().mylogindata.user_id, LoginInfo.Instance().mylogindata.room_id.ToString(), LoginInfo.Instance().mylogindata.choosegame.ToString()); string str = JsonMapper.ToJson(login); SocketSend(str); }
private void handleData(DataPacket data) { switch (data.type) { case "LOGINRESPONSE": { DataPacket <LoginResponsePacket> d = data.GetData <LoginResponsePacket>(); if (d.data.status == "OK") { this._loggedIn = true; OnLogin?.Invoke(this._loggedIn, d.data.chatLog); Console.WriteLine("You are logged in!"); } else if (d.data.status == ("ERROR")) { this._loggedIn = false; OnLogin?.Invoke(this._loggedIn, d.data.chatLog); Console.WriteLine("Your username and/or password is not valid!"); } break; } case "REGISTERRESPONSE": { DataPacket <RegisterResponsePacket> d = data.GetData <RegisterResponsePacket>(); if (d.data.status == "OK") { this._registered = true; OnRegister?.Invoke(this._registered); Console.WriteLine("You are Registered"); this._loggedIn = true; OnLogin?.Invoke(this._loggedIn, d.data.chatLog); Console.WriteLine("You are logged in!"); } else if (d.data.status == ("ERROR")) { this._registered = false; OnRegister?.Invoke(this._registered); Console.WriteLine("Your username is already taken"); } break; } case "CHAT": { DataPacket <ChatPacket> d = data.GetData <ChatPacket>(); OnChatReceived?.Invoke($"{d.data.chatMessage}\r\n"); break; } default: Console.WriteLine("Type is not valid"); break; } }
private void btn_Login(object sender, EventArgs e) { OnLogin LoginDelegate = () => Dispatcher.BeginInvoke(() => NavigationService.Navigate(new Uri("/UsersList.xaml", UriKind.Relative))); OnException ExceptionDelegate = (ex) => Dispatcher.BeginInvoke(() => MessageBox.Show(ex.Message)); CTConnection.ResetProxy(); CTConnection.LoginUser(txtName.Text, txtPassword.Password, LoginDelegate, ExceptionDelegate); }
internal async Task Login(OnLogin login = null) { await AnClient.Login(uid, pswd, "device.c#", login == null?new OnTestLogin() : login); if (!succeed) { Assert.Fail("Failed: onOk not called."); } Assert.IsNotNull(client); }
public void Logout() { if (now.Name != "DefaultUser") { Logger.Log(ATSData.RunLog, now.Name + " 登出"); } now = DefaultUser; IsLogin = false; OnLogin.Invoke(this, new EventArgs()); }
/// <summary> /// Login and return a client instance (with session managed by jserv). /// </summary> /// <param name="uid"></param> /// <paramref name="pswdPlain">password in plain</param> /// <param name="device"></param> /// <param name="onlogin"></param> /// <param name="err"></param> /// <throws>SQLException the request makes server generate wrong SQL.</throws> /// <throws>SemanticException Request can not parsed correctly</throws> /// <throws>GeneralSecurityException other error</throws> /// <throws>Exception, most likely the network failed</throws> /// <return>null if failed, a SessionClient instance if login succeed.</return> public static async Task <SessionClient> Login(string uid, string pswdPlain, string device, OnLogin onlogin, OnError err = null) { byte[] iv = AESHelper.getRandom(); string iv64 = AESHelper.Encode64(iv); if (uid == null || pswdPlain == null) { throw new SemanticException("user id and password can not be null."); } // string tk64 = AESHelper.Encrypt("-----------" + uid, pswdPlain, iv); string tk64 = AESHelper.Encrypt(uid, pswdPlain, iv); // formatLogin: {a: "login", logid: logId, pswd: tokenB64, iv: ivB64}; // AnsonMsg<? extends AnsonBody> reqv11 = new AnsonMsg<AnQueryReq>(Port.session);; AnsonMsg reqv11 = AnSessionReq.formatLogin(uid, tk64, iv64, device); string url = ServUrl(new Port(Port.session)); HttpServClient httpClient = new HttpServClient(); SessionClient[] inst = new SessionClient[1]; AnsonMsg msg = await httpClient.Post(url, reqv11).ConfigureAwait(false); MsgCode code = msg.code; if (code != null && MsgCode.ok == code.code) { // create a logged in client inst[0] = new SessionClient(((AnSessionResp)msg.Body()[0]).ssInf); if (onlogin != null) { // onlogin.ok(new SessionClient(((AnSessionResp)msg.Body()[0]).ssInf)); onlogin.ok(inst[0]); } if (AnClient.console) { Console.WriteLine(msg.ToString()); } } else if (err != null) { err.err(new MsgCode(code.code), ((AnsonResp)msg.Body(0)).Msg()); } else { throw new SemanticException( "loging failed\ncode: {0}\nerror: {1}", code, ((AnsonResp)msg.Body()[0]).Msg()); } return(inst[0]); }
private void OnApplicationFocus(bool focus) { if (focus) { OnLogin onLo = new OnLogin("Login", LoginInfo.Instance().mylogindata.user_id, LoginInfo.Instance().mylogindata.room_id.ToString(), LoginInfo.Instance().mylogindata.choosegame.ToString()); string str = JsonMapper.ToJson(onLo); tcp.SendMessage(str); StartCoroutine(GetHistory()); StartCoroutine(OnReGet()); } }
public void SetCurrentSession(IApi api) { ; currentSession = api; if (api != null) { _store.SetSession(api.GetSessionInfo()); } SessionChanged?.Invoke(this, EventArgs.Empty); OnLogin?.Invoke(this, EventArgs.Empty); SessionChanged?.Invoke(this, EventArgs.Empty); }
public LeagueClient(OnError OnErrorCallback, OnLogin OnLoginCallback, OnLeagueClientClosed OnLeagueClientClosedCallback) { this.OnErrorCallback = OnErrorCallback; this.OnLoginCallback = OnLoginCallback; this.OnLeagueClientClosedCallback = OnLeagueClientClosedCallback; running = true; _scanningThread = new Thread(ScanForGame) { IsBackground = true }; _scanningThread.Start(); }
private ClientTester(OnLogin onLogin, string username, string password, string udid = null) { this.onLogin = onLogin; uniqueTag = Guid.NewGuid().ToString().Replace("-", "").Substring(0, 20); Configuration config = new Configuration(); config.ServiceUrl = SERVICE_URL; client = new Client(config); Login(username, password, udid); }
/// <summary> /// 开启服务 /// </summary> /// <param name="data"></param> public NewTcpNet() { isPlayOver = false; //loom = Loom.Current; //获得文本框中的IP地址对象 IPAddress address = IPAddress.Parse(ip); //创建包含IP和端口的网络节点对象 IPEndPoint endpoint = new IPEndPoint(address, prot); //创建客户端套接字,负责连接服务器 socketClient = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _loom = new GameObject().AddComponent <Loom>(); _loom.name = "Loom"; try { //客户端连接到服务器 socketClient.Connect(endpoint); IsKick = false; IsQuit = false; } catch (SocketException ex) { Debug.Log("客户端连接服务器发生异常:" + ex.Message); DisconnectPanel.GetInstance().Show(); DisconnectPanel.GetInstance().Modification("", "连接服务器失败!!"); } catch (Exception ex) { Debug.Log("客户端连接服务器发生异常:" + ex.Message); DisconnectPanel.GetInstance().Show(); DisconnectPanel.GetInstance().Modification("", "连接服务器失败!!"); } Loom.RunAsync( () => { threadClient = new Thread(ReceiveMsg /*ReceiveMessage*/); //将ReceiveMsg传入 threadClient.IsBackground = true; //设置threadClient变量IsBackground为true threadClient.Start(); //调用Start方法 } ); OnLogin login = new OnLogin("Login", LoginInfo.Instance().mylogindata.user_id, LoginInfo.Instance().mylogindata.room_id.ToString(), LoginInfo.Instance().mylogindata.choosegame.ToString()); string str = JsonMapper.ToJson(login); SendMessage(str); //调用SendMessage发送消息到服务器 }
private void Login() { CoroutineJobLogin j = new CoroutineJobLogin(); j.host = this; j.username = emailField.text; j.password = passwordField.text; j.OnStart += () => { loginErrorText.gameObject.SetActive(false); }; j.OnError += (UnityWebRequest request) => { if (request.responseCode == (long)HttpStatusCode.BadRequest) { loginErrorText.text = "Login failed, please try again"; loginErrorText.gameObject.SetActive(true); } }; j.OnResult += (SDKLoginResult result) => { if (result.error == "none") { PlayerPrefs.SetString("login", j.username); PlayerPrefs.SetString("password", j.password); PlayerPrefs.SetString("token", result.token); m_Sdk.developerToken = result.token; m_ToggleMappingMode?.EnableMappingMode(); if (m_ToggleMappingMode?.MappingUI != null) { m_ToggleMappingMode.MappingUI.GetComponent <MapperBase>().OnLogOut += OnLogOut; } loginErrorText.gameObject.SetActive(false); FadeOut(); OnLogin?.Invoke(); } else if (result.error == "auth") { loginErrorText.text = "Login failed, please try again"; loginErrorText.gameObject.SetActive(true); } }; StartCoroutine(j.RunJob()); }
public void LoginAsync(string username, string password, OnLogin OnDone) { Utils.Log.DebugFormat("Logging in as {0}", username); BackgroundWorker bw = new CultureAwareBackgroundWorker(); bw.DoWork += new DoWorkEventHandler(delegate(object sender, DoWorkEventArgs args) { args.Result = _fb.LogOn(username, password); }); bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(delegate(object sender, RunWorkerCompletedEventArgs args) { if (args.Error != null) { Utils.Log.ErrorFormat("Error during login: {0}", args.Error.ToString()); OnDone(false); } else OnDone((bool)args.Result); }); bw.RunWorkerAsync(); }
/// <summary> /// Login to the Lmax Trader platform. The appropriate handler will be called back /// on success or failure. The loginCallback should be the main entry point into /// your trading application. From that point you should add listeners to the /// session, subscribe to resources that you're interested in, e.g. OrderBooks /// and call Start on the <see cref="ISession"/>. /// </summary> /// <param name="loginRequest"> /// A <see cref="LoginRequest"/> that contains your login credentials. /// </param> /// <param name="loginCallback"> /// A <see cref="OnLogin"/> callback, fired when you are successfully logged in. /// </param> /// <param name="failureCallback"> /// A <see cref="OnFailure"/> callback, fired when there is a login failure. /// </param> public void Login(LoginRequest loginRequest, OnLogin loginCallback, OnFailure failureCallback) { LoginResponseHandler handler = new LoginResponseHandler(); try { string sessionId; Response response = _httpInvoker.Invoke(_baseUri, loginRequest, _xmlParser, handler, out sessionId); if (response.IsOk) { if (handler.IsOk) { loginCallback(new Session(handler.AccountDetails, _baseUri, _httpInvoker, _xmlParser, sessionId, true)); } else { failureCallback(new FailureResponse(false, handler.FailureType, handler.Message, null)); } } else { failureCallback(new FailureResponse(true, "HttpStatus: " + response.Status + ", for: " + _baseUri + loginRequest.Uri)); } } catch (Exception e) { failureCallback(new FailureResponse(e, "URI: " + _baseUri + loginRequest.Uri)); } }
RTXSAPILib.RTXSAPIUserManager UserManagerObj; //rtx user obj #endregion Fields #region Constructors public frmAD() { InitializeComponent(); RootObj = new RTXSAPIRootObj(); DeptManagerObj = RootObj.DeptManager; UserManagerObj = RootObj.UserManager; UserAuthObj = RootObj.UserAuthObj; UserAuthObj.OnRecvUserAuthRequest += new _IRTXSAPIUserAuthObjEvents_OnRecvUserAuthRequestEventHandler(UserAuthObj_OnRecvUserAuthRequest); //user auth event RootObj.ServerIP = config.RTXIP; //rtx ip RootObj.ServerPort = config.RTXPort; //rtx port UserAuthObj.AppGUID = config.AppGUID; //app guid UserAuthObj.AppName = config.AppName; //app name try { UserAuthObj.RegisterApp(); //register app UserAuthObj.StartApp("", 8); //start app } catch (COMException ex) { MessageBox.Show(ex.Message); Application.Exit(); } onLogin = new OnLogin(onUserLogin); }