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

C# UserLogin类代码示例

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

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



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

示例1: Page_Load

        protected void Page_Load( object sender, EventArgs e )
        {
            if ( string.IsNullOrEmpty ( txtUserName.Text ) || string.IsNullOrEmpty ( txtPassword.Text ) )
            {
                UserLoginSection _userLoginSection = ( UserLoginSection ) ConfigurationManager.GetSection ( "userLoginGroup/userLogin" );
                if ( _userLoginSection != null )
                {
                    _configUser = new UserLogin () { Login = _userLoginSection.UserLogin, Password = _userLoginSection.UserPassword };
                }
            }
            else
            {
                _configUser = new UserLogin () { Login = txtUserName.Text, Password = txtPassword.Text };
            }

            // Note: Add code to validate user name, password. This code is for illustrative purpose only.
            // Do not use it in production environment.)
            if ( IsAuthentic ( _configUser ) )
            {
                if ( Request.QueryString [ "ReturnUrl" ] != null )
                {
                    FormsAuthentication.RedirectFromLoginPage ( _configUser.Login, false );
                }
                else
                {
                    FormsAuthentication.SetAuthCookie ( _configUser.Login, false );
                    Response.Redirect ( "default.aspx" );
                }
            }
        }
开发者ID:divyang4481,项目名称:REM,代码行数:30,代码来源:Login.aspx.cs


示例2: Setup

 public void Setup() {
     Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);
     if (Directory.Exists(LoginEventStore.EventStorePath)) {
         Directory.Delete(LoginEventStore.EventStorePath, true);
     }
     sut = new UserLogin();
 }
开发者ID:slieser,项目名称:sandbox2,代码行数:7,代码来源:IntegrationTests.cs


示例3: Put

        // PUT odata/UserLogin(5)
        public virtual async Task<IHttpActionResult> Put([FromODataUri] string providerKey, UserLogin userLogin)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (providerKey != userLogin.ProviderKey)
            {
                return BadRequest();
            }

            try
            {
                await MainUnitOfWork.UpdateAsync(userLogin);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MainUnitOfWork.Exists(providerKey))
                {
                    return NotFound();
                }
                else
                {
                    return Conflict();
                }
            }

            return Ok(userLogin);
        }
开发者ID:gitter-badger,项目名称:WealthEconomy,代码行数:31,代码来源:UserLoginsController.cs


示例4: changeUsername_Click

    protected void changeUsername_Click(object sender, EventArgs e)
    {
        Guid uid = new Guid(Session["UserID"].ToString());

        UserLogin checkit = UserLogin_S.Loging(newUsername.Text);
        if (checkit == null)
        {

            UserLogin newUser = new UserLogin();

            newUser.UserName = newUsername.Text;
            newUser.UserId = uid;

            bool upd = UserLogin_S.ResetUsername(newUser);

            if (upd == true)
            {
                green0.Text = "Updated";
                Session["UserName"] = newUsername.Text;
                username.Text = newUsername.Text;
            }
            else
            {
                green0.Text = "Something went wrong!";

            }
            valid.Text = "";
        }
        else
        {
            valid.Text = "Not-Available";
            green0.Text = "";
        }
    }
开发者ID:nipunbatra,项目名称:Energy,代码行数:34,代码来源:ResetUserPassword.aspx.cs


示例5: BaseViewModel

 protected BaseViewModel(IMessenger messenger, UserLogin userLogin)
 {
     Messenger = messenger;
     Initialize();
     if (UserLogin == null)
         UserLogin = userLogin;
 }
开发者ID:ruisebastiao,项目名称:WPF-MVVM-With-Entity-Framework,代码行数:7,代码来源:BaseViewModel.cs


示例6: SetPasswordFromRest

        /// <summary>
        /// Sets the password from rest.
        /// </summary>
        /// <param name="value">The value.</param>
        private void SetPasswordFromRest( UserLogin value )
        {
            UserLoginWithPlainTextPassword userLoginWithPlainTextPassword = null;
            string json = string.Empty;

            this.ActionContext.Request.Content.ReadAsStreamAsync().ContinueWith( a =>
            {
                // to allow PUT and POST to work with either UserLogin or UserLoginWithPlainTextPassword, read the the stream into a UserLoginWithPlainTextPassword record to see if that's what we got
                a.Result.Position = 0;
                StreamReader sr = new StreamReader( a.Result );

                json = sr.ReadToEnd();
                userLoginWithPlainTextPassword = JsonConvert.DeserializeObject( json, typeof( UserLoginWithPlainTextPassword ) ) as UserLoginWithPlainTextPassword;
            } ).Wait();

            if ( userLoginWithPlainTextPassword != null )
            {
                // if a UserLoginWithPlainTextPassword was posted, and PlainTextPassword was specified, encrypt it and set UserLogin.Password
                if ( !string.IsNullOrWhiteSpace( userLoginWithPlainTextPassword.PlainTextPassword ) )
                {
                    ( this.Service as UserLoginService ).SetPassword( value, userLoginWithPlainTextPassword.PlainTextPassword );
                }
            }
            else
            {
                // since REST doesn't serialize Password, get the existing Password from the database so that it doesn't get NULLed out
                var existingUserLoginRecord = this.Get( value.Id );
                if (existingUserLoginRecord != null)
                {
                    value.Password = existingUserLoginRecord.Password;
                }
            }
        }
开发者ID:SparkDevNetwork,项目名称:Rock,代码行数:37,代码来源:UserLoginsController.Partial.cs


示例7: resetPassword_Click

    protected void resetPassword_Click(object sender, EventArgs e)
    {
        Guid uid = new Guid(Session["UserID"].ToString());

        UserLogin checkit = UserLogin_S.NewLoging(username.Text, psHidOld.Value);

        if (checkit != null)
        {
            UserLogin newPwdUser = new UserLogin();

            newPwdUser.Password = psHid.Value;
            newPwdUser.UserId = uid;
            newPwdUser.PasswordStatus = "done";

            bool upd = UserLogin_S.ResetPassword(newPwdUser);

            if (upd == true)
            {
                green1.Text = "Updated";
            }
            else
            {
                green1.Text = "Something went wrong!";
            }
            pwdCheck.Text = "";
        }
        else
        {
            pwdCheck.Text = "Wrong-Password";
            green1.Text = "";
        }
    }
开发者ID:nipunbatra,项目名称:Energy,代码行数:32,代码来源:ResetUserPassword.aspx.cs


示例8: ApollosUserLogin

 public ApollosUserLogin( UserLogin userLogin )
 {
     Guid = userLogin.Guid;
     Id = userLogin.Id;
     PersonId = userLogin.PersonId;
     ApollosHash = userLogin.Password;
     UserName = userLogin.UserName;
 }
开发者ID:NewSpring,项目名称:rock-apollos,代码行数:8,代码来源:ApollosUserLogin.cs


示例9: LoginUser

        public LoginUser()
        {
            _userLogin = new UserLogin();
            _client.UserLoginCompleted += new EventHandler<UserLoginCompletedEventArgs>(_client_UserLoginCompleted);
            _client.UserLoginOutCompleted += new EventHandler<UserLoginOutCompletedEventArgs>(_client_UserLoginOutCompleted);
            _client.GetSystemTypeByUserIDCompleted += new EventHandler<GetSystemTypeByUserIDCompletedEventArgs>(_client_GetSystemTypeByUserIDCompleted);

        }
开发者ID:JuRogn,项目名称:OA,代码行数:8,代码来源:LoginUser.cs


示例10: IsAuthentic

        private bool IsAuthentic( UserLogin userLogin )
        {
            if ( userLogin == null )
                return false;

            bool valid = _authenticatedUsers.Any ( u => ( u.Login == userLogin.Login && u.Password == userLogin.Password ) );
            return valid;
        }
开发者ID:divyang4481,项目名称:REM,代码行数:8,代码来源:Login.aspx.cs


示例11: FromIUserLogin

        public static UserLogin FromIUserLogin(IUserLogin i)
        {
            UserLogin l = new UserLogin();

            l.LoginProvider = i.LoginProvider;
            l.ProviderDisplayName = i.ProviderDisplayName;
            l.ProviderKey = i.ProviderKey;
            l.SiteId = i.SiteId;
            l.UserId = i.UserId;

            return l;
        }
开发者ID:ludev,项目名称:cloudscribe,代码行数:12,代码来源:UserLogin.cs


示例12: Authenticate

        /// <summary>
        /// Authenticates the specified user name and password
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="password">The password.</param>
        /// <returns></returns>
        public override bool Authenticate( UserLogin user, string password )
        {
            string username = user.UserName;
            if ( !String.IsNullOrWhiteSpace( GetAttributeValue( "Domain" ) ) )
                username = string.Format( @"{0}\{1}", GetAttributeValue( "Domain" ), user.UserName );

            var context = new PrincipalContext( ContextType.Domain, GetAttributeValue( "Server" ) );
            using ( context )
            {
                return context.ValidateCredentials( user.UserName, password );
            }
        }
开发者ID:pkdevbox,项目名称:Rock,代码行数:18,代码来源:ActiveDirectory.cs


示例13: Login

		public ActionResult Login(UserLogin model, string returnUrl) {
			if (!ModelState.IsValid)
				return ViewBase(DIALOG, "LoginForm", model);
			//User user = userService.ValidateUser(model.UserName, model.Password);
			//if (user != null) {
			User user = new User {
				Login = "qwe",
				Name = "qwerwer"

			};
			SignInAsync(user, model.RememberMe);
			return RedirectBase("Index", "Home");// ViewBase("#loginButtons", "_LoginPartial");
			//}
			ModelState.AddModelError("", "Неверное имя пользователя или пароль.");
			return ViewBase("#dialogsContainer", "LoginForm", model);
		}
开发者ID:paradoxfm,项目名称:basemvcsharp,代码行数:16,代码来源:AccountController.cs


示例14: calculatePrint

    protected void calculatePrint(UserLogin userData)
    {
        try
        {
            UserMapping map = UserMapping_S.MapUser(userData.UserId);
            if (map != null)
            {
                DateTime frDate = DateTime.ParseExact(fromDate.Value + ",000", "dd/MM/yyyy HH:mm:ss,fff",
                                           System.Globalization.CultureInfo.InvariantCulture);
                DateTime tDate = DateTime.ParseExact(toDate.Value + ",000", "dd/MM/yyyy HH:mm:ss,fff",
                                           System.Globalization.CultureInfo.InvariantCulture);
                if (frDate != null && tDate != null)
                {
                    Utilities utFr = Utilitie_S.DateTimeToEpoch(frDate);
                    Utilities utTo = Utilitie_S.DateTimeToEpoch(tDate);
                    List<FetchingEnergy> energy = FetchingEnergy_s.fetchBillingData(utFr.Epoch, utTo.Epoch, map.MeterId, map.Apartment);

                    if (energy != null)
                    {
                        float en = energy[1].FwdHr - energy[0].FwdHr;
                        float untPrice = 3;
                        decimal bill = Convert.ToDecimal(en * untPrice);
                        bill = Math.Round(bill, 2);

                        fullName.InnerText = userData.FullName;

                        unitsConsumed.InnerText = (energy[1].FwdHr - energy[0].FwdHr).ToString();
                        address.InnerText = userData.Apartment;
                        mobile.InnerText = userData.Mobile;

                        meterNo.InnerText = map.Apartment + " - " + map.MeterId.ToString();
                        billPeriod.InnerText = frDate.ToString("dd-MMM-yyyy") + " - " + tDate.ToString("dd-MMM-yyyy");
                        unitRate.InnerText = untPrice.ToString() + " Rs/unit";
                        total.InnerText = bill.ToString();
                        billAmount.InnerHtml = "Bill Amount: Rs " + bill.ToString();
                        dueDate.InnerHtml = "Due Date: " + DateTime.Now.AddDays(15).ToString("dd-MMM-yyyy");
                        billNo.InnerText = "Rep " + meterNo.InnerText + " - " + DateTime.Today.ToString("dd-MMM-yyyy");
                        billDate.InnerText = DateTime.Now.ToString("dd-MMM-yyyy");
                    }
                }
            }
        }
        catch (Exception e)
        {

        }
    }
开发者ID:nipunbatra,项目名称:Energy,代码行数:47,代码来源:ClassicBill.aspx.cs


示例15: lazyinit

        private void lazyinit()
        {
            repositoy = new ServiceRepository();
            IService entity = null;

            entity = new GetUserInfo();
            repositoy.storeServiceEntity(service_type.GET_USER_INFO, entity);

            entity = new RegistUser();
            repositoy.storeServiceEntity(service_type.REGIST_USER, entity);

            entity = new UserLogin();
            repositoy.storeServiceEntity(service_type.USER_LOGIN, entity);

            entity = new DeleteTravelDiary();
            repositoy.storeServiceEntity(service_type.DELETE_TRAVEL_DIARY, entity);

            entity = new UpdateTravelDiary();
            repositoy.storeServiceEntity(service_type.UPDATE_TRAVEL_DIARY, entity);

            entity = new PublishTravelDiary();
            repositoy.storeServiceEntity(service_type.PUBLISH_TRAVEL_DIARY, entity);

            entity = new GetTravelDiariesList();
            repositoy.storeServiceEntity(service_type.GET_TRAVEL_DIARYLIST, entity);

            entity = new GetTravelDiaryDetailInfo();
            repositoy.storeServiceEntity(service_type.GET_TRAVEL_DIARY_DETAIL, entity);

            entity = new GetTravelComments();
            repositoy.storeServiceEntity(service_type.GET_TRAVEL_COMMENT, entity);

            entity = new GetAssociatedProductsInfo();
            repositoy.storeServiceEntity(service_type.GET_ASSOCIATED_PRODUCT, entity);

            entity = new GetCategory();
            repositoy.storeServiceEntity(service_type.GET_DISPLAY_CATEGORY, entity);

            entity = new CollectTravelDiary();
            repositoy.storeServiceEntity(service_type.COLLECT_TRAVEL_DIARY, entity);

            entity = new ReserveProduct();
            repositoy.storeServiceEntity(service_type.RESERVE_PRODUCT, entity);

            return;
        }
开发者ID:CtripHackthon,项目名称:TravelOnline,代码行数:46,代码来源:ServiceFactory.cs


示例16: AddUserLogin

 public static bool AddUserLogin(string connectionString, UserLogin userLogin)
 {
     try
     {
         using (var context = new UserLoginDBContext(connectionString))
         {
             context.UserLogins.Add(userLogin);
             var result = context.SaveChanges();
             return result > 0;
         }
     }
     catch (Exception exception)
     {
         NLogLogger.LogError(exception, TitleResources.Error, ExceptionResources.ExceptionOccured,
                             ExceptionResources.ExceptionOccuredLogDetail);
         return false;
     }
 }
开发者ID:ruisebastiao,项目名称:WPF-MVVM-With-Entity-Framework,代码行数:18,代码来源:UserLoginAction.cs


示例17: Register

        public async Task<IHttpActionResult> Register(UserLogin userModel)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            IdentityResult result = await _repo.RegisterUser(userModel);

            IHttpActionResult errorResult = GetErrorResult(result);

            if (errorResult != null)
            {
                return errorResult;
            }

            return Ok();
        }
开发者ID:sahilkhan99,项目名称:AppRepositoryData,代码行数:18,代码来源:AccountController.cs


示例18: Create

        public void Create()
        {
            // Saving changes using the session API
            using (IDocumentSession session = documentStore.OpenSession()) {
            // Operations against session

            Party p = new Party();
            UserLogin userLogin = new UserLogin();
            userLogin.Username = "dev1";
            userLogin.Password = "dev1";
            userLogin.party = p;
            session.Store(p);
            session.Store(userLogin);
            // Flush those changes
            session.SaveChanges();
            }
              Console.WriteLine("Completed");
        }
开发者ID:leveragesystems,项目名称:leverage_api,代码行数:18,代码来源:Seed.cs


示例19: Authenticate

        /// <summary>
        /// Authenticates the specified user name and password
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="password">The password.</param>
        /// <returns></returns>
        public override bool Authenticate( UserLogin user, string password )
        {
            var passwordIsCorrect = CheckF1Password( user.UserName, password );

            if ( passwordIsCorrect )
            {
                using ( var rockContext = new RockContext() )
                {
                    var userLoginService = new UserLoginService( rockContext );
                    var userFromService = userLoginService.Get( user.Id );
                    var databaseGuid = Rock.SystemGuid.EntityType.AUTHENTICATION_DATABASE.AsGuid();
                    userFromService.EntityTypeId = EntityTypeCache.Read( databaseGuid ).Id;
                    userLoginService.SetPassword( userFromService, password );
                    rockContext.SaveChanges();
                }
            }

            return passwordIsCorrect;
        }
开发者ID:NewSpring,项目名称:rock-f1,代码行数:25,代码来源:F1Migrator.cs


示例20: Login

 public HttpResponseMessage Login(UserLogin login)
 {
     HttpResponseMessage response = new HttpResponseMessage();
     response.StatusCode = System.Net.HttpStatusCode.Unauthorized;
     if (login != null)
     {
         int? userId;
         if (_userService.ValidateUserLogin(login.UserName, login.Password, out userId))
         {
             var identity = new ClaimsIdentity(CookieAuthenticationDefaults.AuthenticationType);
             identity.AddClaim(new Claim(ClaimTypes.Name, userId.ToString()));
             OwinHttpRequestMessageExtensions.GetOwinContext(this.Request).Authentication.
             SignIn(identity);
             response.StatusCode = System.Net.HttpStatusCode.OK;
             response.Content = new StringContent("Success");
         }
     }
     return response;
 }
开发者ID:asifashraf,项目名称:proSignalR,代码行数:19,代码来源:LoginController.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# UserLogin_mst类代码示例发布时间:2022-05-24
下一篇:
C# UserKey类代码示例发布时间: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