ref out
摘要:They're pretty much the same - the only difference is that a variable you pass as an out parameter doesn't need to be initialized but passing it as a
阅读全文
ConditionalAttribute 类
摘要:指示编译器应忽略方法调用或属性,除非已定义指定的条件编译符号。 #define CONDITION1#define CONDITION2using System;using System.Diagnostics;class Test{ static void Main() { Console.Wri
阅读全文
类型构造器
摘要:class constructor IL代码里描述为.cctor 类型构造器只会被clr调用一次
阅读全文
const和readonly
摘要:const常量始终是类型相关的,编译时就会嵌入到元数据中,引用该值的代码编译成IL代码时会直接写入到IL代码中,如果更改了常量的值,则引用的程序集中必须重新编译,而不能只替换定义常量的程序集。 readonly是被初始化到动态内存中的,如果再加以 static则是与类型相关的。
阅读全文