Type type =result.GetType();
typeof(result));

解决方案 »

  1.   

    GetType方法,或者typeof关键字。。
      

  2.   

    你传的什么高级类型,竟然会报错Type type =result.GetType(); 
    Type type = typeof( T );如果根据不同数据类型作不同处理,也可以这样            if ( result is int )
                {
                    MessageBox.Show( "Int" );
                }
                else if ( result is Form )
                {
                    MessageBox.Show( "Form" );
                }
                else
                {
                    MessageBox.Show( "Other" );
                }
      

  3.   

    static Type TestMethod<T>(T result)
            {
                Type type = result.GetType();
                return type;
            }
      

  4.   

    typeof 只能用于。,不知道怎么表达,就是类型名称,如int Form TextBox,不能用于这些类的实例。
    GetType是实例方法。
      

  5.   


    Type t = typeof(T);
      

  6.   

    public TOutput Method<TInput,TOutput>(TInput T)
    {}
      

  7.   

    if(result is 类名)
    或者result.GetType().ToString()就知道是什么类型了