MxWeiXinPF.Common/PageTemplate.cs
(开头部分) 22KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.IO;
using System.Xml;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
namespace MxWeiXinPF.Common
{
/// <summary>
/// Template为页面模板类.
/// </summary>
public abstract class PageTemplate
{
public static Regex[] r = new Regex[23];
static PageTemplate()
{
RegexOptions options = RegexOptions.None;
//嵌套模板标签(兼容)
r[0] = new Regex(@"<%template ((skin=\\""([^\[\]\{\}\s]+)\\""(?:\s+))?)src=(?:\/|\\"")([^\[\]\{\}\s]+)(?:\/|\\"")(?:\s*)%>", options);
//模板路径标签(新增)
r[1] = new Regex(@"<%templateskin((=(?:\\"")([^\[\]\{\}\s]+)(?:\\""))?)(?:\s*)%>", options);
//命名空间标签
r[2] = new Regex(@"<%namespace (?:""?)([\s\S]+?)(?:""?)%>", options);
//C#代码标签
r[3] = new Regex(@"<%csharp%>([\s\S]+?)<%/csharp%>", options);
//loop循环(抛弃)
r[4] = new Regex(@"<%loop ((\(([^\[\]\{\}\s]+)\) )?)([^\[\]\{\}\s]+) ([^\[\]\{\}\s]+)%>", options);
//foreach循环(新增)
r[5] = new Regex(@"<%foreach(?:\s*)\(([^\[\]\{\}\s]+) ([^\[\]\{\}\s]+) in ([^\[\]\{\}\s]+)\)(?:\s*)%>", options);
//for循环(新增)
r[6] = new Regex(@"<%for\(([^\(\)\[\]\{\}]+)\)(?:\s*)%>", options);
//if语句标签(抛弃)
r[7] = new Regex(@"<%if (?:\s*)(([^\s]+)((?:\s*)(\|\||\&\&)(?:\s*)([^\s]+))?)(?:\s*)%>", options);
r[8] = new Regex(@"<%else(( (?:\s*)if (?:\s*)(([^\s]+)((?:\s*)(\|\||\&\&)(?:\s*)([^\s]+))*))?)(?:\s*)%>", options);
//if语句标签(新增)
r[9] = new Regex(@"<%if\((([^\s]+)((?:\s*)(\|\||\&\&)(?:\s*)([^\s]+))?)\)(?:\s*)%>", options);
r[10] = new Regex(@"<%else(( (?:\s*)if\((([^\s]+)((?:\s*)(\|\||\&\&)(?:\s*)([^\s]+))?))?\))(?:\s*)%>", options);
//循环与判断结束标签(兼容)
r[11] = new Regex(@"<%\/(?:loop|foreach|for|if)(?:\s*)%>", options);
//continue标签
r[12] = new Regex(@"<%continue(?:\s*)%>");
//break标签
r[13] = new Regex(@"<%break(?:\s*)%>");
//request标签
r[14] = new Regex(@"(\{request\[([^\[\]\{\}\s]+)\]\})", options);
//截取字符串标签
r[15] = new Regex(@"(<%cutstring\(([^\s]+?),(.\d*?)\)%>)", options);
//url链接标签
r[16] = new Regex(@"(<%linkurl\(([^\s]*?)\)%>)", options);
//声明赋值标签(兼容)
r[17] = new Regex(@"<%set ((\(?([\w\.<>]+)(?:\)| ))?)(?:\s*)\{?([^\s\{\}]+)\}?(?:\s*)=(?:\s*)(.*?)(?:\s*)%>", options);
//数据变量标签
r[18] = new Regex(@"(\{([^\[\]\{\}\s]+)\[([^\[\]\{\}\s]+)\]\})", options);
//普通变量标签
r[19] = new Regex(@"({([^\[\]/\{\}=:'\s]+)})", options);
//时间格式转换标签
r[20] = new Regex(@"(<%datetostr\(([^\s]+?),(.*?)\)%>)", options);
//整型转换标签
后面还有 396 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
