摘要: namespace ExtensionMethods{ using System; using System.Collections.Generic; using System.Linq; public static class IEnumerableExtensions { /// <summary> /// Invokes a transform function on each element of a sequence and returns the minimum Double value /// if the sequence is not empty; otherwi 阅读全文
posted @ 2011-04-14 18:51 梦幻泡影 阅读(511) 评论(2) 推荐(0) 编辑
摘要: select id from infoid-----------123567810111215(11 行受影响)方法一:select (select max(id)+1 from Info where id<a.id) as beginId,(id-1) as endIdfrom Info awherea.id>(select max(id)+1 from Info where id<a.id)beginId endId----------- -----------4 49 913 14(3 行受影响)方法二:select beginId,(select min(id)-1 阅读全文
posted @ 2011-04-14 18:40 梦幻泡影 阅读(515) 评论(1) 推荐(0) 编辑
摘要: 摘自 http://www.cnblogs.com/ejiyuan/archive/2009/07/20/1527224.html[代码] 阅读全文
posted @ 2011-04-14 17:03 梦幻泡影 阅读(329) 评论(0) 推荐(0) 编辑
摘要: ///<summary> /// equiv of PHP's var dump for an object’s properties because i cbf writing all the properties out. ///</summary> ///<param name="info"></param> private static string var_dump(object info) { StringBuilder sb = new StringBuilder(); Type t = info.Get 阅读全文
posted @ 2011-04-14 16:59 梦幻泡影 阅读(1580) 评论(0) 推荐(0) 编辑
摘要: 出处:http://blogs.thesitedoctor.co.uk/tim/2010/02/27/Collapse+All+Solution+Explorer+Items+In+Visual+Studio+2010.aspxImports SystemImports EnvDTEImports EnvDTE80Imports EnvDTE90Imports System.Diagnostics'-----------------------------------------------------------' CollapseAll Module'------- 阅读全文
posted @ 2011-04-14 16:42 梦幻泡影 阅读(686) 评论(0) 推荐(0) 编辑
摘要: public class ExportDataGirdViewToExcel { /// <summary> /// 将DataGirdView数据,导出EXCEL文件。需要下载 MyXls。 /// 代码摘自 http://topic.csdn.net/u/20101231/09/039bdd22-3f0a-4bbb-908e-d887b4d7bbfe.html?19933 /// </summary> /// <param name="dgv">DataGridView控件名称</param> /// <param 阅读全文
posted @ 2011-04-14 16:27 梦幻泡影 阅读(684) 评论(0) 推荐(0) 编辑
摘要: public static class ProtectConfigFileUtil{ /// <summary> /// 加密配置节示例,加密 ConnectionStrings 和 AppSettings /// </summary> [Obsolete("这个方法只是示例")] public static void ProtectConnectionStringsAndAppSettings(HttpContext context) { Configuration config = WebConfigurationManager.OpenWebC 阅读全文
posted @ 2011-04-14 08:11 梦幻泡影 阅读(289) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// Form1 的构造函数 /// </summary> public Form1() { InitializeComponent(); this.Left = Screen.PrimaryScreen.WorkingArea.Right - this.Width; this.Top = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height; } 阅读全文
posted @ 2011-04-14 07:52 梦幻泡影 阅读(714) 评论(1) 推荐(0) 编辑
摘要: 摘自 csdn// 看了看别的资料有提取CPU,MAC的现成代码却没有硬盘序列号,找了好久才找到提取硬盘序列号的参数。于是自己给补上了。 <script> function disk() {//硬盘序列号 信息 var locator = new ActiveXObject ("WbemScripting.SWbemLocator"); var service = locator.ConnectServer("."); var properties = service.ExecQuery("SELECT * FROM Win32_D 阅读全文
posted @ 2011-04-13 16:39 梦幻泡影 阅读(1619) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// ChunkHelper 帮助将序列分成若干块。 /// /// 如果 totalItemCount 是 11,chunkSize 是 5,则: /// chunk[0] 0, 1, 2, 3, 4 /// chunk[1] 5, 6, 7, 8, 9 /// chunk[2] 10 /// </summary> public class ChunkHelper { /// <summary> /// /// </summary> /// <param name="totalItemCount&q 阅读全文
posted @ 2011-04-13 16:27 梦幻泡影 阅读(272) 评论(0) 推荐(0) 编辑