xiacy

导航

2011年10月9日 #

对老赵写的简单性能计数器的修改

摘要: 早上看到老赵写的这个性能计数器,感觉很实用,不过老赵用了很多.C# 3.0 的新语法,还用了 VISTA 和 Server 2008 下特有的Win32 API,对于还在用C#2.0 或者还工作在 XP 或者 Server 2003 下的兄弟们,只能望代码心叹了。应老赵的要求,我修改了他的代码,增加了对低版本C# 和 低版本windows 操作系统的支持。 老赵的原文: 一个简单的性能计数器:CodeTimer 修改说明 1. 采用 接口 取代了原代码中的 Lambda 表达式 2. 采用 GetThreadTimes 这个API 函数替代了原代码中的 QueryThreadCycleTime 阅读全文

posted @ 2011-10-09 15:39 xiacy 阅读(303) 评论(0) 推荐(0) 编辑

反射-利用泛型把枚举绑定到listControl

摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Reflection;namespace WindowsFormsApplication1{ public partial class Form1 : Form { public Form1() ... 阅读全文

posted @ 2011-10-09 09:56 xiacy 阅读(169) 评论(0) 推荐(0) 编辑

利用反射绑定下拉列表

摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Reflection;namespace WindowsFormsApplication1{ public partial class Form1 : Form { public Form1() ... 阅读全文

posted @ 2011-10-09 09:44 xiacy 阅读(184) 评论(0) 推荐(0) 编辑