• 防Post提交


    public static bool CheckUrl()
            {
                Uri ComeUrl = HttpContext.Current.Request.UrlReferrer;
                string cUrl;
                if (ComeUrl == null)
                { return false; }
                else
                {
                    string reffer = ComeUrl.ToString();
                    cUrl = "http://" + HttpContext.Current.Request.ServerVariables["SERVER_NAME"];


                    if (reffer.Substring(cUrl.Length, 1) == ":")
                    {
                        cUrl += ":" + HttpContext.Current.Request.ServerVariables["SERVER_PORT"].ToString();
                    }
                    int lenth;
                    lenth = cUrl.Length;
                    cUrl += HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"];
                    int result;
                    result = String.Compare(reffer, 1, cUrl, 1, lenth, true);
                    return (result == 0);
                }
            }

  • 相关阅读:
    eclipse3.2 汉化 汉化包下载
    JAXB 操作XML 与 Object
    具体解释三层架构图
    四个好看的CSS样式表格
    LinearGradient线性渲染
    JAVA wait(), notify(),sleep具体解释
    System.currentTimeMillis();
    nefu117 素数个数的位数,素数定理
    java jdk缓存-128~127的Long与Integer
    js正則表達式语法
  • 原文地址:https://www.cnblogs.com/Traner/p/2820005.html
Copyright © 2020-2023  润新知