///<summary>

   ///多行文字進行串連

   ///</summary>

   ///<param name="strQ"></param>

   ///<returns></returns>

   public static string setString(List<string> strQ)

   {

       var strBuilder = new StringBuilder();

       foreach (var i in strQ)

       {

           strBuilder.Append(i);

       }

       return strBuilder.ToString();

   }

 

   ///<summary>

   ///移除特殊字元

   ///</summary>

   ///<param name="strQ"></param>

   ///<returns></returns>

   public static string setSpecialString(object strQ)

   {

       if (strQ == null || "".Equals(strQ.ToString()))

       {

           return "";

       }

       var tList = new List<string>(){

           "<","&lt",

           ">","&gt",

           "*/","/*","/",

           "'", "&#39",

           "--"

       };

       string tS = strQ.ToString();

       foreach (var i in tList)

       {

           tS = tS.Replace(i, Strings.StrConv(i, VbStrConv.Wide, 0));

       }

       var tList2 = new List<string>()

       {

           "script",

           "xp_cmdshell"

       };

       foreach (var i in tList2)

       {

           tS = Regex.Replace(tS, i, "", RegexOptions.IgnoreCase);

       }

       return tS;

   }

 

   ///<summary>

   ///判斷Form是否有值

   ///</summary>

   ///<param name="tP"></param>

   ///<param name="tList"></param>

   ///<returns></returns>

   public static void setNullForm(Page tP, List<string> tList)

   {

       foreach (var i in tList)

      {

           if (tP.Request.Form[i] == null)

           {

               tP.Response.Write("<div align='center'>請依正常管道登入f!!</div>");

               tP.Response.End();

           }

       }

   }

 

, , , ,

倧齊 發表在 痞客邦 PIXNET 留言(0) 人氣()