08 2013 档案
摘要:/// /// 计算执行时间的类/// public class QueryPerformance{ [DllImport("Kernel32.dll")] private static extern bool QueryPerformanceCounter(out long performanceCount); [DllImport("Kernel32.dll")] private static extern bool QueryPerformanceFrequency(out long frequency); private long begintT
阅读全文
摘要:public 类型 CloneOf(类型 model){ object objCopy = null; MemoryStream stream = new MemoryStream(); BinaryFormatter binFormatter = new BinaryFormatter(); binFormatter.Serialize(stream, model); stream.Position = 0; objCopy = (T)binFormatter.Deserialize(stream); stream.Close(); retur...
阅读全文
摘要:新建一个类,继承IMessageFilter public class FormFilter : IMessageFilter { public bool PreFilterMessage(ref Message m) { if (m.Msg == 0x20A) return true; return false; } }在需要禁用鼠标滚轮的窗体内加入下面的代码FormFilter ff =...
阅读全文
摘要:Ling的简单查询,记在这里防止忘记,以便随时能够查看List intArr = new List();var v = from i in intArr where i == 0 || i == 100 select i;List result = v.ToList();
阅读全文