使用会话登录和注销系统. [英] Login and logout System using session.
问题描述
大家好,
我在桌面应用程序中制作了一个简单的登录系统.
我是网络新手.我想制作一个ASP登录系统,使用户可以使用C#在asp.net中登录和注销.
我认为可以使用会话来完成.但是对此一无所知.
谁能给我推荐一篇很好的文章.
在此先感谢.
Hi All,
I made a simple login system in desktop applications.
I am new in web. I want to make asp login system where user can login and logout in asp.net using C#.
I think this can done using sessions. But no idea on this.
Can anyone suggest me a good articles on this..
Thanks in Advance.
推荐答案
要在Session中设置一些值,
您只需要写:>
To set some value in Session,
you just have to write:>
Session["anyName"]="any Value";
这样,您将在您的Session变量"anyName"中存储字符串"any Value".
要检索该值时,只需编写:>
By doing this, you will store the string "any Value" in your Session variable named "anyName".
When you want to retrieve that value, you just have to write:>
string variable="";
if (Session["anyName"]!=null)
variable = Session["anyName"].ToString();
要登录,请检查是否:>
To Login, you check whether :>
if(Session["anyName"]!=null)
{.
.
.
.
...
}else
Response.Redirect("Login.aspx");
等等...
And so.on...
在asp.net网站中,登录,注销,创建用户,密码恢复是内置的功能.您只需将控件放下并对其进行配置即可.试试此链接以了解如何使用此控件
http://msdn.microsoft.com/en-us/library/ms998347.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/ms178329.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/system. web.security.membership.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/aa479008.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/ms178329(VS .85).aspx [ ^ ]
或者您可以编写原始代码进行登录
谢谢
In asp.net web LogIn, LogOut, Create User, Password recovery is built in features. you just drug n drop the control and configure it that it. try this link for how to use this control
http://msdn.microsoft.com/en-us/library/ms998347.aspx[^]
http://msdn.microsoft.com/en-us/library/ms178329.aspx[^]
http://msdn.microsoft.com/en-us/library/system.web.security.membership.aspx[^]
http://msdn.microsoft.com/en-us/library/aa479008.aspx[^]
http://msdn.microsoft.com/en-us/library/ms178329(VS.85).aspx[^]
or you can write raw code for login
Thanks
http://www.daniweb.com/web- development/aspnet/threads/19303 [ ^ ]
http://2enetworx.com/dev/samples/seclogin.asp [
http://www.daniweb.com/web-development/aspnet/threads/19303[^]
http://2enetworx.com/dev/samples/seclogin.asp[^]
这篇关于使用会话登录和注销系统.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!