System.Int32 = int 
System.String = string
System.Boolean =bool
System.Char = char你说的char 和string 可以,Bool 和Int不行。

解决方案 »

  1.   

    int、string、bool、char实际就是System.Int32,System.String,....
    而你已经using System;所以可以直接写Int32,String...
    不过Int应该不行吧。
      

  2.   

    但我在定義變量時用String x;卻可以執行,而且效果好像和string x;沒什麼區別,為什麼?
      

  3.   

    因为对编译器来说 String x;与 string x; 都是指System.String x;再明白了吧
      

  4.   

    那 System.Web.UI.WebControls.Unit;的作用是什麼?如何使用?謝了
      

  5.   

    你的代码中肯定使用了
    using System ;
    你用的String是System.String的省略写法。
      

  6.   

    ms-help://MS.VSCC/MS.MSDNVS.2052/csref/html/vclrfbuiltintypes.htmC# 类型  .NET 框架类型 
    bool      System.Boolean 
    byte      System.Byte 
    sbyte     System.SByte 
    char      System.Char 
    decimal   System.Decimal 
    double    System.Double 
    float     System.Single 
    int       System.Int32 
    uint      System.UInt32 
    long     System.Int64 
    ulong    System.UInt64 
    object    System.Object 
    short     System.Int16 
    ushort    System.UInt16 
    string     System.String