如何限制asp.net 4.5中的访问权限 [英] How to Restrict the access in asp.net 4.5

查看:79
本文介绍了如何限制asp.net 4.5中的访问权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有



如何将未注册用户重定向到登录页面。如果他试图直接在地址栏中写下安全页面的URL?









问候

Dear All

How to redirect the un registered user to the login page. If he attempt to directly write the Url of secured page in the address bar?




Regards

推荐答案

您可以检查http引用来查看它是否为空,但您可以欺骗它。您可以在首页的会话中存储一些内容,然后检查该值,这样如果有人直接将您的受限制站点作为第一页,那么会话变量将为空。
You can check the http referrer to see if it's empty, but you can spoof that. You could store something in the session on your front page, then check for that value so if someone goes direct to your restricted site as the first page then the session variable will be empty.


这篇关于如何限制asp.net 4.5中的访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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