摘要: 感谢xiashengwang提供。原文地址:http://www.cnblogs.com/xiashengwang/p/4024505.html#3077216 1 using System; 2 using System.Collections.Generic; 3 using System.Te... 阅读全文
posted @ 2014-12-03 14:27 寂小魔 阅读(1142) 评论(0) 推荐(0) 编辑
摘要: 1 class Program 2 { 3 static void Main(string[] args) 4 { 5 var list = new List { 6 new Demo{ id=1,age=18, name="Tim"}, 7 new Demo{ id=2,age=22, name="Allen"}, 8 new Demo{ id=3,age=24, name="Jim"} 9 ... 阅读全文
posted @ 2013-12-17 16:13 寂小魔 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 1 DateTime dt = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now, TimeZoneInfo.Local); 2 DateTime dt1 = TimeZoneInfo.ConvertTimeFromUtc(dt, TimeZoneInfo.FindSystemTimeZoneById("New Zealand Standard Time"));//参数对应国家或者时区 下面有相关国家和时区对应参数 3 MessageBox.Show("本地当前时间:" + DateT... 阅读全文
posted @ 2013-10-26 15:55 寂小魔 阅读(3856) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 单表查询结果转换成泛型集合 --实体类的字段名 需要与DataTable的列名一致 3 /// 4 /// 泛型集合类型 5 /// 查询结果DataTable 6 /// 以实体类为元素的泛型集合 7 public static IList convertToList(DataTable dt) where T : new() 8 { 9 // 定义集合 10 List ts... 阅读全文
posted @ 2013-08-16 17:56 寂小魔 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 1 /// <summary> 2 /// 取得内容中所有匹配的 Email地址。 3 /// </summary> 4 /// <param name="sHtmlText">内容</param> 5 /// <returns>匹配列表</returns> 6 public static string[] GetContentList(string sHtmlText) 7 { 8 //string pattern = @"<div class=[^<>]... 阅读全文
posted @ 2013-04-07 10:48 寂小魔 阅读(235) 评论(0) 推荐(0) 编辑