
.Net
hnhl
这个作者很懒,什么都没留下…
展开
-
Net垃圾收集一点领悟
内存管理器在后台以较低的优先级终结对象。只有当系统的可用内存较少时,此优先级才会提高。这种“懒惰”的垃圾回收方案允许快速分配对象。原创 2004-10-15 12:08:00 · 989 阅读 · 0 评论 -
几个C#编程的小技巧 (一)
一、最小化窗口点击“X”或“Alt+F4”时,最小化窗口,如:protected override void WndProc(ref Message m){const int WM_SYSCOMMAND = 0x0112;const int SC_CLOSE = 0xF060;if (m.Msg == WM_SYSCOMMAND && (int) m.WParam == SC_CLOSE){//原创 2004-11-02 22:48:00 · 1163 阅读 · 0 评论 -
几个C#编程的小技巧 (二)
几个C#编程的小技巧 (二) 发表时间:2003-5-11 一、判断文件或文件夹是否存在使用System.IO.File,要检查一个文件是否存在非常简单: bool exist = System.IO.File.Exists(fileName);如果需要判断目录(文件原创 2004-11-02 23:26:00 · 1036 阅读 · 0 评论 -
C#Attribute的使用(一)
类的特性using System;public enum RemoteServers{ TTT, AAA, CHAIN}public class RemoteObjectAttribute:Attribute{ public RemoteObjectAttribute ( RemoteServers Server) { this.server=Server; } protected Remote原创 2004-11-19 01:56:00 · 1599 阅读 · 0 评论 -
关键字params使用
1.使用关键字”params”并在方法的参数值列表中指定一个数组就可以指定可变数目的方法参数。原创 2004-11-16 23:51:00 · 1279 阅读 · 0 评论 -
Attribute使用(二)
单次特性和多次特性using System;using System.Reflection;[AttributeUsage(AttributeTargets.All,AllowMultiple=true)] //不指定AllowMultiple=true编译汇报错,C#特性默认是单次public class SingleUseAttribute:Attribute{ public SingleU原创 2004-11-20 22:17:00 · 1311 阅读 · 1 评论 -
关于接口
使用接口,可以在单个类中实现多种行为特征。在C#中,可以从单个类中派生,并且,除了拥有那些通过继承得到的功能外,还可以按照类的需要实现任意多的接口。关于接口的建议:永远都要把对象转换到您所要使用的成员变量所在的那个接口.原创 2004-11-22 00:25:00 · 1670 阅读 · 0 评论