用户身份验证和登录 [英] Authentication of user and login

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

问题描述

我想创建论坛应用程序,例如asp.net论坛.用户登录后发帖时.当匿名者看到帖子并且想要回复

他将点击回复"按钮.那时他应该注册或登录.

在这里,我想要他单击时如何答复,我们如何检查他是否已通过身份验证.

请帮助我

thanq.

I want to create forum application like asp.net forums. when user posts after login. when anonymous person sees the post and if he wants to reply

he will clck reply button. At that time he should register or he should login.

here i want how when he click reply how we can check he is authenticated or not.

please help me

thanq.

推荐答案

在用户登录成功后保持会话.
在答复"按钮中,单击事件检查会话变量,如果session为null,则要求用户注册或登录.
希望对您有帮助.
Maintain a session when user login is successful.
In Reply button click event check the session variable and if session is null then ask user to register or login.
hope it helps you.


如果您使用MembershipProviders(MS或您自己的),则可以使用User对象:
If you use MembershipProviders (either MS or your own) then you can use the User object:
if (User.Identity.IsAuthenticated)
   {
   ...
   }

MSDN可以提供帮助: http://msdn.microsoft.com /en-us/library/system.web.httpcontext.user.aspx [

MSDN can help: http://msdn.microsoft.com/en-us/library/system.web.httpcontext.user.aspx[^]


这篇关于用户身份验证和登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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