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();
            }
          
  • 相关阅读:
    C++中new申请动态数组
    iOS 9之3D Touch功能
    在xcode找不到发布证书
    iOS 企业版 打包
    iOS证书详解--转载
    Failed to load the JNI shared library jvm.dl
    Xcode7.3打包ipa文件 报错和解决
    更新mac系统和更新到Xcode7.3版本出现的: cannot create __weak reference in file using manual reference counting
    Sun jdk, Openjdk, Icedtea jdk关系
    terminal color
  • 原文地址:https://www.cnblogs.com/songsh96/p/719742.html
Copyright © 2011-2022 走看看