zoukankan      html  css  js  c++  java
  • 检查URL参数是否合法

     string combinationID = Request.QueryString["CombinationID"];
            string buyingPriceListID = Request.QueryString["PriceListID"];
            if (combinationID != null && CommonFunction.IsInt(combinationID) && combinationID.Length < int.MaxValue.ToString().Length)
            {
                m_CombinationID = int.Parse(combinationID.ToString());
            }
            if (buyingPriceListID != null && CommonFunction.IsInt(buyingPriceListID) && buyingPriceListID.Length < int.MaxValue.ToString().Length)
            {
                m_BuyingPriceListID = int.Parse(buyingPriceListID.ToString());
            }

    public static bool IsInt(string input)
            
    {
                
    return Regex.IsMatch(input, @"^\d+$");
            }


    string script = "<script type='text/javascript'>alert('{0}');window.location.href='BuyingPriceList.aspx';</script>";
            
    if (this.m_CombinationID == 0 || !entityCombination.ObjectExist)
            
    {
                script 
    = string.Format(script, this.getMessage("M10022"));
                Response.Write(script);
                Response.End();
            }

            
    if (this.m_BuyingPriceListID == 0 || !entityBPList.ObjectExist)
            
    {
                script 
    = string.Format(script, this.getMessage("M10023"));
                Response.Write(script);
                Response.End();
            }
          
  • 相关阅读:
    UVa-133-救济金发放
    UVa-340-猜数字
    UVa-1584-环状序列
    UVa-1585-得分
    UVa-1586-分子量
    BZOJ-3289: Mato的文件管理(莫队算法+树状数组)
    HDU-2824 The Euler function(欧拉函数)
    2017年10月12日22:27:20
    HDU-4715 Difference Between Primes(线性筛法)
    POJ-1185 炮兵阵地(状态压缩DP)
  • 原文地址:https://www.cnblogs.com/songsh96/p/719742.html
Copyright © 2011-2022 走看看