上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 32 下一页
摘要: /// <summary> /// 两个对象中相同属性赋值,R代表目标实体,T代表数据源实体 /// </summary> public static R MappingObject<R, T>(R newData,T oldData) { if (newData == null) { newDat 阅读全文
posted @ 2021-08-05 15:20 超级驼鹿 阅读(316) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 设置对象中为空的属性值,即对象的所有属性均有值(集合数组属性不能设置) /// </summary> /// <typeparam name="T"></typeparam> /// <param name="source">数据源</param> /// <pa 阅读全文
posted @ 2021-07-08 08:42 超级驼鹿 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 1.问题:返回的xml字符串含有 &lt &gt 2.使用 using System.Web 中的方法 HttpUtility.HtmlDecode(str) 实现 反转义 解密 HttpUtility.UrlEncode(str)实现转义 加密 阅读全文
posted @ 2021-06-17 11:59 超级驼鹿 阅读(1572) 评论(0) 推荐(0) 编辑
摘要: 1.封装被调用库 public delegate string CallBack(string message); public int MyInterfance(CallBack cb) { return cb("张天才"); } 2.使用调用库 int ret = MyInterfance(ca 阅读全文
posted @ 2021-06-10 18:26 超级驼鹿 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 反射+泛型方法 public static bool ObjectIsNullOrEmpty<T>(T t) { foreach (var item in t.GetType().GetProperties()) { if (item.GetValue(t) == null) { return tr 阅读全文
posted @ 2021-05-26 10:34 超级驼鹿 阅读(969) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 32 下一页
/*