摘要: /// <summary> /// 防XSS攻击 /// date:2020-07-28 /// </summary> public class XssFilter : ActionFilterAttribute { private const string strRegex = @"<[^>]+? 阅读全文
posted @ 2020-07-28 15:38 tommy~hi 阅读(725) 评论(0) 推荐(0) 编辑
摘要: public class AppAuthorFilterAttribute : ActionFilterAttribute { private readonly string _appid; public AppAuthorFilterAttribute(string appid) { _appid 阅读全文
posted @ 2020-07-22 16:18 tommy~hi 阅读(121) 评论(0) 推荐(0) 编辑
摘要: //编码格式 private static string inputCharset = "utf-8"; /// <summary> /// 签名字符串 /// </summary> /// <param name="prestr">需要签名的字符串</param> /// <param name= 阅读全文
posted @ 2020-07-17 14:32 tommy~hi 阅读(439) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 把数组所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串,并对参数值做urlencode /// </summary> /// <param name="dicArray">需要拼接的数组</param> /// <param name="code">字 阅读全文
posted @ 2020-07-17 14:26 tommy~hi 阅读(498) 评论(0) 推荐(0) 编辑
摘要: petapoco中使用in关键字需要使用命名参数,否则是无效的(或者只查出第一个条件的记录) 例如: public List<model> GetRate(string from) { using (var db = MDb()) { var sql = new StringBuilder(); s 阅读全文
posted @ 2020-07-08 09:28 tommy~hi 阅读(366) 评论(0) 推荐(0) 编辑
摘要: public abstract class MqHelper { protected static IConnection defaultConnection = null; private static ConnectionFactory ConnectionFactory; public sta 阅读全文
posted @ 2020-07-02 13:16 tommy~hi 阅读(424) 评论(0) 推荐(0) 编辑
摘要: public class IdCardHelper { /// <summary> /// 验证身份证结果 /// </summary> /// <param name="idcard">身份证号码</param> /// <param name="msg"></param> /// <return 阅读全文
posted @ 2020-07-01 18:31 tommy~hi 阅读(206) 评论(0) 推荐(0) 编辑
摘要: net core中使用petapoco连接mysql数据库。database.tt生成类时报错: Failed to load provider `MySql.Data.MySqlClient` - 找不到请求的 .Net Framework Data Provider。可能没有安装 安装:mysq 阅读全文
posted @ 2020-06-28 17:19 tommy~hi 阅读(651) 评论(0) 推荐(0) 编辑
摘要: function formatMoney(val, row) { if (!isNaN(val)) { var source = String(val.toFixed(2)).split("."); //按小数点分成2部分 source[0] = source[0].replace( new Reg 阅读全文
posted @ 2020-06-18 18:54 tommy~hi 阅读(319) 评论(0) 推荐(0) 编辑
摘要: $.post( // 请求地址,发送的数据,发送请求成功后的回调函数 'action.php', {d:'' }, function(msg){ // msg是返回的数据,数据类型在type参数里定义! }, 'json' // 返回数据的类型。可以是:string或json类型,默认返回字符串 ) 阅读全文
posted @ 2020-06-18 18:53 tommy~hi 阅读(778) 评论(0) 推荐(0) 编辑