C#技术库

1、boxing/unboxing
装箱就是将值类型(value type)转换为引用类型(reference type)的过程;反之,就是拆箱
值类型-> Object(装箱) 反之,就是拆箱

box的时候,我们不需要显式的类型转换,但是在unbox时就必须进行类型转换。

2、System.Collections.Generic.list item=new System.Collections.Generic.list(count)
可以返回数组: return item.toArray();

3、验证是否为空:
text = text.Trim();
if (string.IsNullOrEmpty(text)) return string.Empty;

4、在类里使用跳转:HttpContext.Current.Response.Redirect
posted @ 2007-09-25 09:54  Microbar  阅读(244)  评论(2编辑  收藏  举报