呵呵,你是说异常吧?
这是Msdn中 Object.GetType Method  [C#] 专题的内容,希望对你有帮助Gets the Type of the current instance.[Visual Basic]
<Serializable>
<ClassInterface(ClassInterfaceType.AutoDual)>
Public Function GetType() As Type
[C#]
[Serializable]
[ClassInterface(ClassInterfaceType.AutoDual)]
public Type GetType();
[C++]
[Serializable]
[ClassInterface(ClassInterfaceType.AutoDual)]
public: Type* GetType();
[JScript]
public
   Serializable
   ClassInterface(ClassInterfaceType.AutoDual)
function GetType() : Type;
Return Value
The Type instance that represents the exact runtime type of the current instance.Res
For two objects x and y that have identical runtime types, Object.ReferenceEquals(x.GetType(),y.GetType()) returns true.The Type object exposes the metadata associated with the class of the current Object.Example
[C#, JScript] The following code example demonstrates that GetType returns the runtime type of the current instance.[C#] 
using System;public class MyBaseClass: Object {
}public class MyDerivedClass: MyBaseClass {
}public class Test {   public static void Main() {
      MyBaseClass myBase = new MyBaseClass();
      MyDerivedClass myDerived = new MyDerivedClass();
      object o = myDerived;
      MyBaseClass b = myDerived;      Console.WriteLine("mybase: Type is {0}", myBase.GetType());
      Console.WriteLine("myDerived: Type is {0}", myDerived.GetType());
      Console.WriteLine("object o = myDerived: Type is {0}", o.GetType());
      Console.WriteLine("MyBaseClass b = myDerived: Type is {0}", b.GetType());
   }
}
/*This code produces the following output.mybase: Type is MyBaseClass
myDerived: Type is MyDerivedClass
object o = myDerived: Type is MyDerivedClass
MyBaseClass b = myDerived: Type is MyDerivedClass */

解决方案 »

  1.   

    还是叫异常更合适,可能翻译书的人不是搞电脑的。
    给你一段简单的程序,你试试。
    private void Form1_Click(object sender, System.EventArgs e)
    {
    try
    {
    int i1=2;
    int i2=0;
    int i=i1/i2;
    }
    catch(Exception ee)
    {
    MessageBox.Show(ee.GetType().ToString());

    }
    }
      

  2.   

    java中有异常类型的编号,不知道c#中有没有,有的话,如何得到?
      

  3.   

    java中的异常有个异常类型编号,不知道c#中是否也存在?存在的话如何得到?
    3x
      

  4.   

    检查MSDN的类库会列出相应方法抛出的全部异常,分别处理就可以了。
      

  5.   

    ft没法给一部分分数么?一定要保证总分100么?,ftft