2006年4月28日

[再读书]索引器

摘要: class Person { private string strName = string.Empty; public Person(string strName) { this.strName = strName; } public string StrName { ... 阅读全文

posted @ 2006-04-28 14:22 萝卜青菜 阅读(232) 评论(0) 推荐(0) 编辑

2006年4月25日

yield关键字与数据源

摘要: 今天遇到的问题,记下来,主要是想回忆一下IEnumerable也可以做数据源。 using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.W... 阅读全文

posted @ 2006-04-25 16:20 萝卜青菜 阅读(294) 评论(0) 推荐(0) 编辑

2006年4月24日

让窗体的关闭按钮无效

摘要: 有很多时候我们需要让窗体的关闭按钮无效,所以。。。。首先引入命名空间。 using System.Runtime.InteropServices; 然后DllImport以及常量声明。 [DllImport("user32", EntryPoint = "GetSystemMenu", SetLastError = true,CharSet = CharSet.Unicode, Exa... 阅读全文

posted @ 2006-04-24 14:45 萝卜青菜 阅读(578) 评论(2) 推荐(0) 编辑

2006年4月22日

计算程序运行时间

摘要: 在.net2.0中提供了Stopwatch类,简单例子 using System.Diagnostics;private Stopwatch stw = new Stopwatch(); private void Form1_Load(object sender, EventArgs e) { stw.Start(); } ... 阅读全文

posted @ 2006-04-22 15:52 萝卜青菜 阅读(449) 评论(0) 推荐(0) 编辑

Hashtable忽略大小写

摘要: 在.net1.1中这样写 Hashtable htTemp = new Hashtable( new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer() ); 到了,.net2.0后提示过期所以可以像下面这样写。 class myCultureComparer : IEqualityComparer { ... 阅读全文

posted @ 2006-04-22 14:54 萝卜青菜 阅读(668) 评论(0) 推荐(0) 编辑

导航