04 2013 档案

把已有的集合重置
摘要:/// <summary> /// 随机一个重置集合 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="inputList"></param> /// <returns></returns> public static List<T> GetRandomList<T>(List<T> inputList) { //Copy to a ar 阅读全文

posted @ 2013-04-26 17:25 水行者 阅读(204) 评论(0) 推荐(0) 编辑

自动生成文件夹
摘要:FileInfo fi = new FileInfo(newUrl); if (!fi.Directory.Exists) { fi.Directory.Create(); } 阅读全文

posted @ 2013-04-25 12:36 水行者 阅读(184) 评论(0) 推荐(0) 编辑

SQL: 随机从数据库取值
摘要:select ArticleId, Title,CreateDate from (SELECT top 2 * FROM [Article] Where ArticleId <10 Order By NewId() ) AS AUNION select ArticleId,Title,CreateDate from (SELECT top 8 * FROM [Article] Where ArticleId >10 Order By NewId() ) AS B//*********************************************************** 阅读全文

posted @ 2013-04-17 11:42 水行者 阅读(218) 评论(0) 推荐(0) 编辑

汉字转换为拼音
摘要:1先引用ChnCharInfo.dll(这个可以在网上下到,如果实在下载不到!直接Q,我发给你)public class ChineseToPinYins { public static Dictionary<int, string> ChineseToPinYin(Dictionary<int, string> chinese) { Dictionary<int, string> newChinese = new Dictionary<int, string>(); int xuhao = 0; ... 阅读全文

posted @ 2013-04-11 15:52 水行者 阅读(235) 评论(0) 推荐(0) 编辑

图片下载(直接通过网站url 下载图片)
摘要:/// <summary> /// 图片下载 /// </summary> /// <param name="imageList"></param> /// <param name="FileDir"></param> /// <returns></returns> private bool DownloadImage(List<string> imageList, string FileDir) { bool result = true; try 阅读全文

posted @ 2013-04-03 11:33 水行者 阅读(528) 评论(0) 推荐(0) 编辑

正则表达式语法
摘要:表达式匹配/^\s*$/匹配空行。/\d{2}-\d{5}/验证由两位数字、一个连字符再加 5 位数字组成的 ID 号。/<\s*(\S+)(\s[^>]*)?>[\s\S]*<\s*\/\1\s*>/匹配 HTML 标记。下表包含了元字符的完整列表以及它们在正则表达式上下文中的行为:字符说明\将下一字符标记为特殊字符、文本、反向引用或八进制转义符。例如,“n”匹配字符“n”。“\n”匹配换行符。序列“\\”匹配“\”,“\(”匹配“(”。^匹配输入字符串开始的位置。如果设置了 RegExp 对象的 Multiline 属性,^ 还会与“\n”或“\r”之后的位置 阅读全文

posted @ 2013-04-02 10:47 水行者 阅读(190) 评论(0) 推荐(0) 编辑

获取当前程序的相当路径
摘要:static string str = System.Environment.CurrentDirectory; 阅读全文

posted @ 2013-04-01 15:14 水行者 阅读(105) 评论(0) 推荐(0) 编辑

导航

点击右上角即可分享
微信分享提示