• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# LoginStatus类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中LoginStatus的典型用法代码示例。如果您正苦于以下问题:C# LoginStatus类的具体用法?C# LoginStatus怎么用?C# LoginStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LoginStatus类属于命名空间,在下文中一共展示了LoginStatus类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: _processLogin

      private void _processLogin(string loginName, LoginStatus status, Action<LoginResult> onResult) {
         var result = new LoginResult { Status = status };
         if (status == LoginStatus.Success) {
            var session = _createOscarSession(loginName);
            if (session == null) {
               onResult(new LoginResult { Status = LoginStatus.SessionBlocked });
               Log.Warn("Unable to create user session.");
               return;
            }
            var preferences = new GetSettingsSection { DriverId = session.UserId, Section = _dSessionSection };
            Services.Invoke(preferences, o => {
               if (o != null) {
                  var defaultVehicle = o.Get(_dVehicle);
                  if (defaultVehicle.NotNull()) {
                     session.VehicleId = BplIdentity.Get(defaultVehicle.Value);
                  }
                  var defaultLocale = o.Get(_dLocale);
                  if (defaultLocale.NotNull()) {
                     session.UserLocale = new Locale(defaultLocale.Value);
                  }
               } else {
                  Log.Info("Login: No preferences for driver {0} stored.", session.UserId);
               }

               result.SessionToken = CryptServices.Encode(session);
               onResult(result);
            }, e => {
               Log.Warn("Login: Error processing preference request {0}", e);
               result.SessionToken = CryptServices.Encode(session);
               onResult(result);
            });
         } else {
            onResult(result);
         }
      }
开发者ID:borkaborka,项目名称:gmit,代码行数:35,代码来源:WebProxy.Login.cs


示例2: PerformLogin

	IEnumerator PerformLogin(string username, string password){
		loginStatus = LoginStatus.LoggingIn;
		WWWForm loginForm = new WWWForm();
		loginForm.AddField("username", username);
		loginForm.AddField("unity", 1);
		loginForm.AddField("password", password);
		loginForm.AddField("submitted", 1);
		WWW www = new WWW( LOGIN_URL, loginForm );
		yield return www;
		if(www.error != null){
			Debug.Log("ERROR ON LOGIN: "+ www.error);
		}
		else{
			string encodedString = www.data;
			Debug.Log(encodedString);
			JSONObject j = new JSONObject(encodedString);
			// Debug.Log(j.list);
			// Debug.Log(j.HasField("id_u"));
			if(j.HasField("id_u")){
				string uID = j.GetField("id_u").str;
				
				userID = int.Parse(uID);
				Debug.Log("User "+ userID + " has logged In");
				loginStatus = LoginStatus.LoggedIn;
			}
		}
		
		yield return 0;
	}
开发者ID:ivhpMX,项目名称:new-york,代码行数:29,代码来源:UserManagement.cs


示例3: LoginHandler

 /// <summary>
 /// Initialize everything that needs to be initialized once we're logged in.
 /// </summary>
 /// <param name="login">The status of the login</param>
 /// <param name="message">Error message on failure, MOTD on success.</param>
 public void LoginHandler(LoginStatus login, string message)
 {
     if (login == LoginStatus.Success)
     {
         // Start in the inventory root folder.
         CurrentDirectory = Inventory.Store.RootFolder;
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:13,代码来源:TestClient.cs


示例4: SendLoginNotification

        public static void SendLoginNotification(LoginStatus loginStatus, Connection connection)
        {
            if (loginStatus == LoginStatus.Sucess)
            {
                // We should check for a exact number of nodes here when we have the needed infraestructure
                if (ConnectionManager.NodesCount > 0)
                {
                    connection.NodeID = ConnectionManager.RandomNode;

                    AuthenticationRsp rsp = new AuthenticationRsp();

                    // String "None" marshaled
                    byte[] func_marshaled_code = new byte[] { 0x74, 0x04, 0x00, 0x00, 0x00, 0x4E, 0x6F, 0x6E, 0x65 };

                    rsp.serverChallenge = "";
                    rsp.func_marshaled_code = func_marshaled_code;
                    rsp.verification = false;
                    rsp.cluster_usercount = ConnectionManager.ClientsCount + 1; // We're not in the list yet
                    rsp.proxy_nodeid = connection.NodeID;
                    rsp.user_logonqueueposition = 1;
                    rsp.challenge_responsehash = "55087";

                    rsp.macho_version = Common.Constants.Game.machoVersion;
                    rsp.boot_version = Common.Constants.Game.version;
                    rsp.boot_build = Common.Constants.Game.build;
                    rsp.boot_codename = Common.Constants.Game.codename;
                    rsp.boot_region = Common.Constants.Game.region;

                    // Setup session
                    connection.Session.SetString("address", connection.Address);
                    connection.Session.SetString("languageID", connection.LanguageID);
                    connection.Session.SetInt("userType", Common.Constants.AccountType.User);
                    connection.Session.SetLong("userid", connection.AccountID);
                    connection.Session.SetLong("role", connection.Role);

                    // Update the connection, so it gets added to the clients correctly
                    ConnectionManager.UpdateConnection(connection);

                    connection.Send(rsp.Encode());
                }
                else
                {
                    // Pretty funny, "AutClusterStarting" maybe they mean "AuthClusterStarting"
                    GPSTransportClosed ex = new GPSTransportClosed("AutClusterStarting");
                    connection.Send(ex.Encode());

                    Log.Trace("Client", "Rejected by server; cluster is starting");
                    connection.EndConnection();
                }
            }
            else if (loginStatus == LoginStatus.Failed)
            {
                GPSTransportClosed ex = new GPSTransportClosed("LoginAuthFailed");
                connection.Send(ex.Encode());

                connection.EndConnection();
            }
        }
开发者ID:Almamu,项目名称:EVESharp,代码行数:58,代码来源:TCPHandler.cs


示例5: UpdateFacebookId

        async private void UpdateFacebookId(LoginStatus status)
        {
            if (status == LoginStatus.LoggedIn)
            {
                await PreloadUserInformation();
            }

            this.LoadPicture();
        }
开发者ID:alykhaled,项目名称:facebook-winclient-sdk,代码行数:9,代码来源:ProfilePicture.cs


示例6: Start

    void Start() {
        Debug.Log("LoginScene Start");

        //init
        status = LoginStatus.WAIT;
        controller = ClientController.Instance;
        addListener();

        Log.game.Debug("Game Started");
    }
开发者ID:kimkidae,项目名称:UnityMinaClient,代码行数:10,代码来源:LoginScene.cs


示例7: Login_Finish

 public static void Login_Finish(User user, LoginStatus status)
 {
     if (status == LoginStatus.Success)
     {
         Contract.usersLoggedIn = Contract.usersLoggedIn.Add(user);
     }
     else // if status == LoginStatus.Failure
         if (Contract.usersLoggedIn.Contains(user))
             Contract.usersLoggedIn = Contract.usersLoggedIn.Remove(user);
     activeLoginRequests = activeLoginRequests.RemoveKey(user);
 }
开发者ID:juhan,项目名称:NModel,代码行数:11,代码来源:Login.cs


示例8: LoginHandler

        /// <summary>
        /// Initialize everything that needs to be initialized once we're logged in.
        /// </summary>
        /// <param name="login">The status of the login</param>
        /// <param name="message">Error message on failure, MOTD on success.</param>
        public void  LoginHandler(LoginStatus login, string message)
        {
            if (login == LoginStatus.Success)
            {
                // Create the stores:
                InventoryStore = new Inventory(Inventory, Inventory.InventorySkeleton);
                LibraryStore = new Inventory(Inventory, Inventory.LibrarySkeleton);

                // Start in the inventory root folder:
                CurrentDirectory = InventoryStore.RootFolder;
            }
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:17,代码来源:TestClient.cs


示例9: Network_OnLogin

 void Network_OnLogin(LoginStatus login, string message)
 {
     if (login == LoginStatus.Failed)
     {
         Display.Error(Session.SessionNumber, "Login failed (" + message + ")");
     }
     else if (login == LoginStatus.Success)
     {
         Display.InfoResponse(Session.SessionNumber, "Connected!");
     }
     else Display.InfoResponse(Session.SessionNumber, message);
 }
开发者ID:cobain861,项目名称:ghettosl,代码行数:12,代码来源:Callbacks.cs


示例10: Network_OnLogin

 private void Network_OnLogin(LoginStatus login, string message)
 {
     if (login == LoginStatus.Success)
     {
         UpdateTimer.Elapsed += new System.Timers.ElapsedEventHandler(UpdateTimer_Elapsed);
         UpdateTimer.Start();
     }
     else if (login == LoginStatus.Failed)
     {
         Console.WriteLine("Login failed: " + Client.Network.LoginMessage);
         Console.ReadKey();
         this.Close();
         return;
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:15,代码来源:frmHeightmap.cs


示例11: Network_OnLogin

 private void Network_OnLogin(LoginStatus login, string message)
 {
     if (login == LoginStatus.Success)
     {
         EnablePlugins(true);
     }
     else if (login == LoginStatus.Failed)
     {
         BeginInvoke(
             (MethodInvoker)delegate()
             {
                 MessageBox.Show(this, String.Format("Error logging in ({0}): {1}",
                     Client.Network.LoginErrorKey, Client.Network.LoginMessage));
                 cmdConnect.Text = "Connect";
                 txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
                 EnablePlugins(false);
             });
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:19,代码来源:frmTestClient.cs


示例12: Login

        public void Login(LoginData data, out string token, out LoginStatus status)
        {
            Smmuser user= SqlMapHelper.DefaultSqlMap.QueryForObject<Smmuser>("SelectSmmuserByKey", data.UserNumber);
            if (user == null)
                status = LoginStatus.InvalidUser;
            else {

                if (MainDataModule.Decrypt(user.Password) == data.Password)
                    status = LoginStatus.OK;
                else
                    status = LoginStatus.InvalidPassword;
            }

            token = string.Empty;
            if (status == LoginStatus.OK) {
                token = Guid.NewGuid().ToString();
                UserStateSingleton.Instance.AddUser(new UserInfo(token, data.UserNumber));
            }
        }
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:19,代码来源:LoginAction.cs


示例13: TryGetAuthenticatedLogin

        public static bool TryGetAuthenticatedLogin(CSSDataContext db, string username, string password, out Login login, out LoginStatus loginStatus)
        {
            loginStatus = LoginStatus.Authenticated;

            login = Login.FindLoginByUsernameOrCallsign(db, username);

            if (login == null)
                loginStatus = LoginStatus.InvalidCredentials;
            else if (login.IsBanned)
                loginStatus = LoginStatus.AccountLocked;
            else
            {
                CssMembershipProvider provider = new CssMembershipProvider();
                if (provider.ValidateUser(login.Username, password) == false)
                    loginStatus = LoginStatus.InvalidCredentials;
                else
                    loginStatus = LoginStatus.Authenticated;
            }

            return loginStatus == LoginStatus.Authenticated;
        }
开发者ID:LordBlacksun,项目名称:Allegiance-Community-Security-System,代码行数:21,代码来源:Login.cs


示例14: LogHistory

 private async Task LogHistory(LoginType loginType, LoginStatus status, string clientId, string username, string deviceKey, string apiKey, string clientIp = null, string clientUri = null)
 {
     var unityContainer = UnityConfig.GetConfiguredContainer() as UnityContainer;
     var loginHistoryBll = unityContainer.Resolve<ILoginHistoryBll>();
     if (string.IsNullOrEmpty(clientIp))
         clientIp =SecurityUtils.GetClientIPAddress();
     if (string.IsNullOrEmpty(clientUri) && HttpContext.Current != null)
         clientUri = HttpContext.Current.Request.Url.AbsoluteUri;
     int num = await loginHistoryBll.InsertLoginHistory(new InsertLoginHistoryInput()
     {
         Type = loginType.GetHashCode(),
         UserName = username,
         LoginTime = DateTime.Now,
         LoginStatus = status.GetHashCode(),
         AppId = string.IsNullOrEmpty(clientId) ? null : clientId,
         ClientUri = clientUri,
         ClientIP = clientIp,
         ClientUA = HttpContext.Current.Request.UserAgent,
         ClientApiKey = apiKey,
         ClientDevice = deviceKey
     });
 }
开发者ID:quangnc0503h,项目名称:ecommerce,代码行数:22,代码来源:ApplicationOAuthProvider.cs


示例15: OnGUI

    void OnGUI() {
        GUI.Box(CenterRect(0, -80, 300, 50), "유니티클라+자바서버 샘플");
        GUI.Box(CenterRect(0, -30, 300, 25), mesage);
        email = GUI.TextField(CenterRect(0, 0, 150, 25), email, 30);
        password = GUI.TextField(CenterRect(0, 25, 150, 25), password, 30);

        //로그인 버튼 클릭시 처리 프로토콜 호출
        if( GUI.Button(CenterRect(0, 55, 50, 25), "login") ) {
            PUserLogin login = new PUserLogin();
            login.sendLogin(email, password);
        }

        //로그인 상태 변경
        if( status == LoginStatus.SUCESS ) {
            Application.LoadLevel("LobbyScene");
        }else if( status == LoginStatus.FAIL ) {
            mesage = "이메일 또는 패스워드가 맞지 않습니다.";
            status = LoginStatus.WAIT;
        }else if( status == LoginStatus.DUPLICATE_LOGIN ) {
            mesage = "중복 로그인으로 인한 실패";
            status = LoginStatus.WAIT;
        }
    }
开发者ID:kimkidae,项目名称:UnityMinaClient,代码行数:23,代码来源:LoginScene.cs


示例16: login

        /// <summary>
        /// Helper function to complete the login procedure and check the
        /// credentials.
        /// </summary>
        /// <returns>Whether the login was successful or not.</returns>
        private bool login()
        {
            loginStatus = LoginStatus.LoginFailed;

            String response = steamRequest("ISteamWebUserPresenceOAuth/Logon/v0001",
                "?access_token=" + accessToken);


            if (response != null)
            {
                JObject data = JObject.Parse(response);

                if (data["umqid"] != null)
                {
                    steamid = (String)data["steamid"];
                    umqid = (String)data["umqid"];
                    message = (int)data["message"];
                    OnLogon(new SteamEvent());
                    loginStatus = LoginStatus.LoginSuccessful;
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }
        }
开发者ID:xedoc,项目名称:JoystickCurves,代码行数:36,代码来源:SteamAPI.cs


示例17: Network_OnLogin

 void Network_OnLogin(LoginStatus login, string message)
 {
     if (login == LoginStatus.Success)
         UpdateFolder(Client.Inventory.Store.RootFolder.UUID);
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:5,代码来源:InventoryTree.cs


示例18: perform

 /// <summary>
 /// 프로토콜 결과 수신
 /// ClientIoHandler -> IClientEventListener -> IUIEventListener.perform
 /// </summary>
 /// <param name="gameEvent"></param>
 public override void perform(ClientEventAbstract clientEvent) {
     //로그인 프로토콜
     if( clientEvent.GetProtocol() == Protocol.USER_LOGIN ) {
         if( clientEvent.GetHResult() == RCode.SUCESS ) {
             status = LoginStatus.SUCESS;
         } else {
             status = LoginStatus.FAIL;
         }
     //중복 로그인 프로토콜
     } else if( clientEvent.GetProtocol() == Protocol.DUPLICATE_LOGIN ) {
         status = LoginStatus.DUPLICATE_LOGIN;
     }
 }
开发者ID:kimkidae,项目名称:UnityMinaClient,代码行数:18,代码来源:LoginScene.cs


示例19: CreateAccount

	IEnumerator CreateAccount(string username, string password, string email){

		WWWForm registerForm = new WWWForm();
		registerForm.AddField("username", username);
		registerForm.AddField("email", email);
		registerForm.AddField("password", password);
		registerForm.AddField("submitted", 1);
		WWW www = new WWW( REGISTER_URL, registerForm );
		yield return www;
		if(www.error != null){
			Debug.Log("ERROR ON REGISTRATION: "+ www.error);
		}
		else{
			string encodedString = www.data;
			Debug.Log(encodedString);
			JSONObject j = new JSONObject(encodedString);
			// Debug.Log(j.list);
			// Debug.Log(j.HasField("id_u"));
			if(j.HasField("id_u")){
				string uID = j.GetField("id_u").str;
				Debug.Log(uID);
				userID = int.Parse(uID);
				Debug.Log(userID + ": Registered and Logged In");
				loginStatus = LoginStatus.LoggedIn;
			}
		}

		yield return 0;
	}
开发者ID:ivhpMX,项目名称:new-york,代码行数:29,代码来源:UserManagement.cs


示例20: LoginHandler

        static void LoginHandler(LoginStatus login, string message)
        {
            Logger.Log(String.Format("Login: {0} ({1})", login, message), Helpers.LogLevel.Info);

            switch (login)
            {
                case LoginStatus.Failed:
                    LoginEvent.Set();
                    break;
                case LoginStatus.Success:
                    LoginSuccess = true;
                    LoginEvent.Set();
                    break;
            }
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:15,代码来源:PacketDump.cs



注:本文中的LoginStatus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LoginViewModel类代码示例发布时间:2022-05-24
下一篇:
C# LoginModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap