关于如何用asp.net确定 链接是否来自外部 应用的法子是: publicboolIsUrl() { stringstr1=System.Web.HttpContext.Current.Request.ServerVariables[HTTP_REFERER]; stringstr2=System.Web.HttpContext.Current.Request.ServerVariables[SERVER_NAME];
热点专题 收藏本站 更多栏目
首页
你的位置: 主页 > 学习交流 > 电脑教程 >

如何用asp.net确定 链接是否来自外部

如何用asp.net确定 链接是否来自外部: 应用的法子是: publicboolIsUrl() { stringstr1=System.Web.HttpContext.Current.Request.ServerVariables[HTTP_REFERER]; stringstr2=System.Web.HttpContext.Current.Request.ServerVariables[SERVER_NAME]; return((str1!=null)(str1.IndexOf(str2)==7)); }
如何用asp.net确定 链接是否来自外部

应用 的法子 是:
public bool IsUrl()     
        {
            string str1 = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_REFERER"];    
            string str2 = System.Web.HttpContext.Current.Request.ServerVariables["SERVER_NAME"];    
            return ((str1 != null) && (str1.IndexOf(str2) == 7));    
        }

    注:如何用asp.net确定 链接是否来自外部一文由大学生活网免费提供,来源于网络。本文著作权归作者所有,请在转载引用时保留。否则因《如何用asp.net确定 链接是否来自外部》一文引起的法律纠纷请自负, 2010-03-10发布。
    编辑提醒:如果觉得文章不错,建议你及时收藏,方便下次访问。
    关于我们 | 联系我们 | 版权声明 | 意见反馈 | 网站地图 | 收藏本站 | 设为首页 | 在线帮助
    大学生活网 Copyright © 2008-2010 All rights reserved.站长QQ:6160-3992