How to limit page access only to localhost?(如何将页面访问仅限于本地主机?)
问题描述
asp.net 中有没有办法限制只能从 localhost 访问网页?
Is there a way in asp.net to limit the access to a web page only from localhost?
推荐答案
if (!HttpContext.Current.Request.IsLocal)
{
Response.Status = "403 Forbidden";
Response.End();
}
这篇关于如何将页面访问仅限于本地主机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!