zoukankan      html  css  js  c++  java
  • 防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);
                }
            }

  • 相关阅读:
    123
    p1216
    离线可持久化动态树
    线段树合并
    p2024
    树的dfs序,p1539,p1651,,2018/11/08模拟赛T3
    p1460
    CDQ分治,二维数点与三维数点,p1357与p2026与p2027与p2028与p2029
    自动AC机
    平衡二叉树之splay p1998
  • 原文地址:https://www.cnblogs.com/Traner/p/2820005.html
Copyright © 2011-2022 走看看