如何在Asp.Net Web应用程序中限制网站 [英] How Do I Restrict Websites In An Asp.Net Webapplication

查看:79
本文介绍了如何在Asp.Net Web应用程序中限制网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个搜索网站,我想限制用户只能查看某些网站,所以当用户进入一个网站(例如,fb)时,它应该显示错误或弹出消息并显示一个屏幕截图并将其发送到admin。

im creating a search site and i wanna restrict the users to view only certain sites so when the user enters a site(eg,fb) it should show a error or popup message and show take a screen shot and send it to the admin.

推荐答案

很明显,创建一些仅限于绝对所有用户的网页是绝对没有意义的。这意味着您希望为某些用户限制某些资源并使其可供其他用户使用。这不合逻辑吗?如果是这样,那实际上意味着用户应该进行身份验证。你可以从学习ASP.NET开始,例如,在这里:

http://msdn.microsoft.com/en-us/library/eeyk640h%28v=vs.140%29.aspx [ ^ ],

< a href =http://www.asp.net/visual-studio/overview/2013/creating-web-projects-in-visual-studio#auth> http://www.asp.net/visual-studio / overview / 2013 / creation-web-projects-in-visual-studio#auth [ ^ ],

http://www.asp.net/web-api/overview/security/basic-authentication [ ^ ]。



Thi CodeProject的文章也很有用: ASP.NET身份验证和授权 [< a href =http://www.codeproject.com/Articles/98950/ASP-NET-authentication-and-authorizationtarget =_ blanktitle =New Window> ^ ]。



-SA
It is apparent that there would be absolutely no point to create some Web pages restricted to absolutely all users. It means that you want to restrict some resources for some users and make them available for others. Isn't that logical? If so, it really means that the users should be authenticated. You can start with learning ASP.NET starting, for example, here:
http://msdn.microsoft.com/en-us/library/eeyk640h%28v=vs.140%29.aspx[^],
http://www.asp.net/visual-studio/overview/2013/creating-web-projects-in-visual-studio#auth[^],
http://www.asp.net/web-api/overview/security/basic-authentication[^].

This CodeProject article can also be useful: ASP.NET authentication and authorization[^].

—SA


这篇关于如何在Asp.Net Web应用程序中限制网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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