当前位置: 首页>>代码示例>>C#>>正文


C# Login类代码示例

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


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

示例1: GetLoginByLoginName

 public static Login GetLoginByLoginName(string loginName)
 {
     Login login = new Login();
     SqlLoginProvider sqlLoginProvider = new SqlLoginProvider();
     login = sqlLoginProvider.GetLoginByLoginName(loginName);
     return login;
 }
开发者ID:anam,项目名称:gp-HO,代码行数:7,代码来源:LoginManager.cs

示例2: Loaded_Method

        private void Loaded_Method()
        {
            Login login = new Login();
            LoginViewModel lvm = new LoginViewModel();
            login.DataContext = lvm;
            login.ShowDialog();

            try
            {
                LoginAccount = lvm.Account;
                AccountName = lvm.Account.AccountName;
                MainModel.MainAccount = lvm.Account;
                AccountPhoto AccountPhotoView = new AccountPhoto(MainFrame);
                AccountPhotoModelView AccountPhotoModelView = new AccountPhotoModelView(MainModel.MainAccount, MainFrame);
                AccountPhotoView.DataContext = AccountPhotoModelView;
                MainFrame.NavigationService.Navigate(AccountPhotoView, UriKind.Relative);
                SearhcEnable = true;
                MainFrame.NavigationService.RemoveBackEntry();
                while (MainFrame.CanGoBack)
                {
                    MainFrame.RemoveBackEntry();
                }
            }
            catch (NullReferenceException)
            {
                AccountName = "Нажмите чтобы войти";
                SearhcEnable = false;
                MainModel.MainAccount = null;
                while (MainFrame.CanGoBack)
                {
                    MainFrame.RemoveBackEntry();
                }
            }
        }
开发者ID:AntonReytarovskiy,项目名称:Polaroid,代码行数:34,代码来源:MainWindowViewModel.cs

示例3: CheckUser

        public static Tecnico CheckUser(Login pLogin)
        {
            try
            {
                StringBuilder sql = new StringBuilder();
                Tecnico tecnico = new Tecnico();

                sql.Append("SELECT * ");
                sql.Append("FROM Tecnico ");
                sql.Append("WHERE Nome='" + pLogin.Nome + "' and Senha='" + pLogin.Senha + "'");

                SqlDataReader dr = SqlConn.Get(sql.ToString());

                while (dr.Read())
                {
                    tecnico.IdTecnico = (int)dr["IdTecnico"];
                    tecnico.Nome = (string)dr["Nome"];
                    tecnico.Senha = (string)dr["Senha"];
                }
                return tecnico;
            }
            catch (Exception)
            {

                return null;
            }
        }
开发者ID:Anderson-Guit,项目名称:Atenda,代码行数:27,代码来源:TecnicoRepository.cs

示例4: Parse

 /// <summary>
 /// converts the string to "Login" object
 /// </summary>
 /// <param name="str">the string. format : [username]_[password]</param>
 /// <returns>the Login object</returns>
 public static Login Parse(string str)
 {
     Login r = new Login();
     r.username = str.Split('_')[0];
     r.password = str.Split('_')[1];
     return r;
 }
开发者ID:arthurzam,项目名称:peulot-heshbon,代码行数:12,代码来源:Login.cs

示例5: LoginTest

 public void LoginTest() {
     var mth = new Login() {
         UserName = "[email protected]",
         Password = "aaabbbcc"
     };
     var a = ApiClient.Execute(mth).Result;
 }
开发者ID:gruan01,项目名称:Lagou.UWP,代码行数:7,代码来源:UnitTest1.cs

示例6: Index

        public ActionResult Index(Login user)
        {
            if (ModelState.IsValid)
            {

                //var login = from user2 in db.Users
                //           where user2.UserName == user.Username && user2.Password == user.Password
                //           select user2;

                //if (login.Count() == 1)
            if(user.Username == "sing1205" && user.Password=="123456")
                {

                    FormsAuthentication.SetAuthCookie(user.Username, false);

                        return RedirectToAction("Index", "Home");

                }
                else
                {
                    ModelState.AddModelError("", "Invalid Username or Password");
                }
            }
            return View();
        }
开发者ID:Gurvinder26,项目名称:TeamPhoenix,代码行数:25,代码来源:LoginController.cs

示例7: Main

        //private WebBrowser showwebpage;
        public Main()
        {
            InitializeComponent();

            //showwebpage = htmlTextBox1.Browser;
            Welcome welcomedlg = new Welcome();
            if (welcomedlg.ShowDialog() == DialogResult.OK)
            {
                Login logindlg = new Login();
                if (logindlg.ShowDialog() == DialogResult.OK)
                {
                    ///////添加登录日志
                }
                else
                {
                    this.Close();
                    //Application.Exit();
                    Environment.Exit(0);
                }
            }

            InfoSource info = new InfoSource();
            info.GetAllInfo();
            InitTreeView();
            InitTagsTree();
            //InitRssSource();
            //更新状态信息
            UpdateManager.UpdateEvent += new UpdateManager.UpdateStatuHandler(UpdateManager_UpdateEvent);

            UseUpdateConfig();
        }
开发者ID:klb3713,项目名称:workspace,代码行数:32,代码来源:Main.cs

示例8: SecurityUserDetails

 public SecurityUserDetails(User user, Login p)
 {
     parent = p;
     InitializeComponent();
     _user = user;
     populateFormFromUser(user);
 }
开发者ID:openhbc,项目名称:openhbc,代码行数:7,代码来源:SecurityUserDetails.cs

示例9: Login

 public ActionResult Login( Login model, string returnUrl ) {
     if ( !ModelState.IsValid ) {
         return View( model );
     } else {
         return RedirectToLocal( "Error" );
     }
 }
开发者ID:ulrich1966,项目名称:PlayHouse,代码行数:7,代码来源:AccountController.cs

示例10: LoginButtonClick

		public async void LoginButtonClick(object sender, EventArgs e)
		{
			LoginPage.loginFail.IsVisible = false;
			if (String.IsNullOrEmpty(LoginPage.username.Text) || String.IsNullOrEmpty(LoginPage.password.Text))
			{
				await DisplayAlert("Validation Error", "Username and Password are required", "Re-try");
			} else {

				//code here for check valid username and password from server
				new System.Threading.Thread (new System.Threading.ThreadStart (() => {
					Device.BeginInvokeOnMainThread (() => {
						LoginPage.loginButton.IsEnabled = false;
						LoginPage.activityIndicator.IsRunning = true;
					});
				})).Start();

				Login loginData = new Login ();
				loginData.lastConnectWebscoketUrl = LoginPage.websocketUrl.Text;
				loginData.username = LoginPage.username.Text;
				loginData.password = sha256_hash(LoginPage.password.Text);
				loginData.flagForLogin = "";
				loginData.node_command = "check_login";

				//no await App.Database.Save_Login_Item (loginData.username, LoginPage.password.Text, "pass", loginData.lastConnectWebscoketUrl);

				string jsonCommandLogin = JsonConvert.SerializeObject(loginData, Formatting.Indented);
				System.Diagnostics.Debug.WriteLine ("jsonCommandLogin" , jsonCommandLogin);
				WebsocketManager.websocketMaster.Send (jsonCommandLogin);
				//WebsocketManager.websocketMaster.Send("{\"cmd_login\":[{\"username\":\"admin\",\"flagForLogin\":\"pass\",\"lastConnectWebscoketUrl\":\"ws://echo.websocket.org\"}]}");
				// no ipm1.showMenuTabPage ();
			}
		}
开发者ID:kabsila,项目名称:HomezigXaml,代码行数:32,代码来源:Login_Page_Action.cs

示例11: Post

        public LoginResponse Post(Login request)
        {
            AuthService authService = ResolveService<AuthService>();

            authService.Post(new Auth {
                provider = AuthService.CredentialsProvider,
                UserName = request.UserName,
                Password = request.Password
            }) ;

            IAuthSession session = this.GetSession();

            //UserManager um = new UserManager(base.RequestContext, AuthRepoProxy);
            //AuthorizationResponse aur = um.GetAuthorization(
            //	new GetAuthorization{UserId=int.Parse(session.UserAuthId)});

            AuthorizationResponse aur= new AuthorizationResponse{Roles= GetFakeRoles()};

            session.Permissions= aur.Permissions.ConvertAll(f=>f.Name);
            session.Roles= aur.Roles.ConvertAll(f=>f.Name);  //(from r in aur.Roles select r.Name).ToList();

            authService.SaveSession(session);

            return new LoginResponse(){
                DisplayName= session.DisplayName.IsNullOrEmpty()? session.UserName: session.DisplayName,
                Roles= aur.Roles,
                Permissions= aur.Permissions

            };
        }
开发者ID:angelcolmenares,项目名称:Calamar,代码行数:30,代码来源:AuthenticationService.cs

示例12: Index

        public ActionResult Index(Login login)
        {
            // UserStore and UserManager manages data retreival.
            UserStore<IdentityUser> userStore = new UserStore<IdentityUser>();
            UserManager<IdentityUser> manager = new UserManager<IdentityUser>(userStore);
            IdentityUser identityUser = manager.Find(login.UserName,
                                                             login.Password);

            if (ModelState.IsValid)
            {
                if (identityUser != null)
                {
                    IAuthenticationManager authenticationManager
                                           = HttpContext.GetOwinContext().Authentication;
                    authenticationManager
                   .SignOut(DefaultAuthenticationTypes.ExternalCookie);

                    var identity = new ClaimsIdentity(new[] {
                                            new Claim(ClaimTypes.Name, login.UserName),
                                        },
                                        DefaultAuthenticationTypes.ApplicationCookie,
                                        ClaimTypes.Name, ClaimTypes.Role);
                    // SignIn() accepts ClaimsIdentity and issues logged in cookie. 
                    authenticationManager.SignIn(new AuthenticationProperties
                    {
                        IsPersistent = false
                    }, identity);
                    return RedirectToAction("SecureArea", "Home");
                }
            }
            return View();
        }
开发者ID:Mariocf93,项目名称:WebSecurity,代码行数:32,代码来源:HomeController.cs

示例13: ProcessPackage

		public async Task ProcessPackage(User user, Login package)
		{
			var users = (await mServer.BD.Find<UserInfo>(u => u.Name == package.Name)).ToArray();
			var result = new Login();
			if (!users.Any())
			{
				result.ID = Guid.Empty;
				await mServer.ClientListener.Send(user, result);
				return;
			}
			var foundUser = users.Single();
			if (!BCrypt.Net.BCrypt.Verify(package.Password, foundUser.PasswordHash))
			{
				result.ID = Guid.Empty;
				await mServer.ClientListener.Send(user, result);
				return;
			}
			if (mServer.Lobby.Values.Any(u => u.Name == package.Name))
			{
				result.ID = Guid.Empty;
				await mServer.ClientListener.Send(user, result);
				return;
			}

			user.ID = foundUser.ID;
			user.Name = foundUser.Name;
			if (foundUser.RoomID != Guid.Empty && mServer.Rooms.ContainsKey(foundUser.RoomID))
				user.Room = mServer.Rooms[foundUser.RoomID];

			result.ID = foundUser.ID;
			await mServer.ClientListener.Send(user, result);
		}
开发者ID:gormel,项目名称:SeaBattle,代码行数:32,代码来源:PackageProcessor.cs

示例14: button2_Click

        private void button2_Click(object sender, EventArgs e)
        {
            string id = textBox1.Text.Trim();
            string password = textBox2.Text.Trim();
            string againPw = textBox3.Text.Trim();

            if (id != "" && password != "" && againPw != "")
            {
                if (SqlAdmin.exitById(id))
                {
                    MessageBox.Show("该用户名已经存在。");
                    return;
                }
                else if (password != againPw)
                {
                    MessageBox.Show("请确保两段密码相同.");
                }
                else
                {
                    Admin admin = new Admin(id,password);
                    SqlAdmin.addAdmin(admin);
                    MessageBox.Show("注册成功.");
                    Login loginView = new Login();
                    loginView.Show();
                    this.Dispose();
                }
            }
            else
            {
                MessageBox.Show("该输入所有数据.");
            }
        }
开发者ID:IrisLinSQ,项目名称:007,代码行数:32,代码来源:Register.cs

示例15: Start

 void Start()
 {
     Login.SetGameMachineApp(this);
     login = gameObject.AddComponent<Login>() as Login;
     login.SetLoginUi(this);
     login.DoLogin();
 }
开发者ID:gamemachine,项目名称:gamemachine,代码行数:7,代码来源:ServerClient.cs


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