表示 type 信息中的缺少值。字段为只读。
使用 Missing 字段通过反射进行调用,以获取参数的默认值。如果传入一个参数值的 Missing 字段,并且该参数没有默认值,则引发异常。
Type.Missing定义为: 
public   static   readonly   object   Missing; 
Type类的构造函数中为此字段进行了初始化,代码为: 
Type.Missing   =   Missing.Value; 
System.Reflection.Missing类定义为: 
public   sealed   class   Missing 
{ 
            static   Missing(){Missing.Value   =   new   Missing();} 
            internal   Missing(); 
            public   static   readonly   Missing   Value; 
} 
所以,他们两个等价,都是System.Reflection.Missing类型。 
虽然Type.Missing定义为object,但是在Type类的静态构造函数中把System.Reflection.Missing.Value赋给了它,所以Type.Missing的类型也变成了System.Reflecton.Missing了. 
你可以运行如下代码进行检测 :
MessageBox.Show(System.Reflection.Missing.Value.GetType().ToString()); 
MessageBox.Show(System.Type.Missing.GetType().ToString());
 
                     
                    
                 
                    
                 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号