使用会话登录页面 [英] login page using session

查看:119
本文介绍了使用会话登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用vb.net&我是新手.
想知道如何使用会话处理登录注销事件.如果除了会话以外的其他任何方式,也请通知我.请给我答复<电子邮件id ="已删除=">

Hi,
i m using vb.net & i m new in it.
Want to know how can i handle login-logout event in it with use of session. If any way other than session than also inform me. Please reply me <email id="" removed="">

推荐答案

在ASP.Net 2.0中,已经引入了登录控件.您可以了解允许用户登录的各种方式.

关于会话的使用,您需要登录用户,并可能用用户个人资料填充会话.在整个应用程序中,您可以访问并使用此会话来验证有关他/她登录的状态.

在注销事件发生时,请明确清除会话.

希望对您有所帮助.
In ASP.Net 2.0, login controls has been introduced. You can read about the various ways it can allow user to login.

About usuage of Session, you would need to login the user and may be fill the session with user-profile. Across the application, you can access and use this session to verify the status about his/her login.

At the time of logout event, clear the session explicitly.

Hope that helps.


会话是处理用户登录的最佳方法.
您可以在成功登录后将UserID存储在Session中,如下所示

Session is the best way to handle the user login.
you can store the UserID in Session after the successful login as below

Session.Add("UserID", txtUser.text);


您还可以从会话中读取以下值


also you can read the value from session as below

string UserID = Session["City"].ToString();



然后您可以从会话中删除该值,如下所示



then you can remove the value from session as below

Session.Remove("UserID");


这篇关于使用会话登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆