ASP.NET VB登录并注销用户 [英] Asp.net vb log in and log out user
本文介绍了ASP.NET VB登录并注销用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在使用asp.net 4.0 vb和SQL Server开发应用程序.
我正在使用asp.net登录控件(Login,LoginView和LoginStatus)
我想为每个用户使用会话.
我需要登录后将会话分配给用户的确切代码行
并单击注销"按钮将其从会话中删除.
谁能帮我.
谢谢您,
Hi All,
I am developing an application using asp.net 4.0 vb and SQL server.
I am using asp.net login controls(Login,LoginView and LoginStatus)
I want to use session for each User.
I want exact lines of code for assign session to user after login
and remove user from session once clicks Logout button.
Can anyone help me.
Thank you,
推荐答案
尽管它不使用登录控件,但确实为您提供了更大的灵活性和安全性.
具有表单身份验证的基于角色的安全性 [
Although this doesn''t use the login controls, it does give you more flexibility and security.
Role-based Security with Forms Authentication[^]
好吧,您现在还不了解您的系统,因为它可以设置您可以使用的会话:
Session("User")=您希望存储的值"
然后,当用户单击注销时要删除/清除会话,可以使用:
session.clear()
或简单地
Session("User")="
Ok with out knowing an awful lot about you system as it currently stands to set the session you can use:
Session("User") = "your value you wish to store"
Then to remove / clear the session when the user clicks logout you can use:
session.clear()
or simply
Session("User") = ""
这篇关于ASP.NET VB登录并注销用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文