Backup/Tsr.Common/PageValidate.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Web;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Web.UI.WebControls;

namespace Tsr.Common
{
   public class PageValidate
    {
        private static Regex RegCHZN;
        private static Regex RegDecimal;
        private static Regex RegDecimalSign;
        private static Regex RegEmail;
        private static Regex RegNumber;
        private static Regex RegNumberSign;
       static PageValidate()
       {
           RegNumber = new Regex("^[0-9]+$");
           RegNumberSign = new Regex("^[+-]?[0-9]+$");
           RegDecimal = new Regex("^[0-9]+[.]?[0-9]+$");
           RegDecimalSign = new Regex("^[+-]?[0-9]+[.]?[0-9]+$");
           RegEmail = new Regex(@"^[\w-]+@[\w-]+\.(com|net|org|edu|mil|tv|biz|info)$");
           RegCHZN = new Regex("[一-龥]");
       }
       public static string Decode(string str)
       {
           str = str.Replace("<br>", "\n");
           str = str.Replace("&gt;", ">");
           str = str.Replace("&lt;", "<");
           str = str.Replace("&nbsp;", " ");
           str = str.Replace("&quot;", "\"");
           return str;
       }
       public static string Encode(string str)
       {
           str = str.Replace("&", "&amp;");
           str = str.Replace("'", "''");
           str = str.Replace("\"", "&quot;");
           str = str.Replace(" ", "&nbsp;");
           str = str.Replace("<", "&lt;");
           str = str.Replace(">", "&gt;");
           str = str.Replace("\n", "<br>");
           return str;
       }
       public static string FetchInputDigit(HttpRequest req, string inputKey, int maxLen)
       {
           string sqlInput = string.Empty;
           if ((inputKey != null) && (inputKey != string.Empty))
           {
               sqlInput = req.QueryString[inputKey];
               if (sqlInput == null)
               {
                   sqlInput = req.Form[inputKey];
               }
               if (sqlInput != null)
               {
                   sqlInput = SqlText(sqlInput, maxLen);
                   if (!IsNumber(sqlInput))
后面还有 112 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。