why static?
楼主去看MSDN里enum的帮助。
enum UserType{NORMAL,VIP};//能否修改以如何定义静态的UserType
-〉
public enum UserType{NORMAL,VIP};

解决方案 »

  1.   

    不好意思,刚刚看过帮助。另一个问题,能否由enum索引反过来得到UserType的成员名称?即给出int值1,得到string值"VIP" ?不过很奇怪在另一个程序集中以下语句可以通过编译,然而在自动弹出的小窗口里面没有提示User有UserType这个成员。using userManagement;
    namespace xxxx{
    ...
    private void button1_Click_1(object sender, System.EventArgs e)
    {


    int a = (int) User.UserType.GUARDIAN;
      

  2.   

    另一个问题,能否由enum索引反过来得到UserType的成员名称?即给出int值1,得到string值"VIP" ?using System;public class GetNameTest {
        enum Colors { Red, Green, Blue, Yellow };
        enum Styles { Plaid, Striped, Tartan, Corduroy };    public static void Main() {        Console.WriteLine("The 4th value of the Colors Enum is {0}", Enum.GetName(typeof(Colors), 3));
            Console.WriteLine("The 4th value of the Styles Enum is {0}", Enum.GetName(typeof(Styles), 3));
        }
    }
      

  3.   

    听 The123(萝卜白菜各有所爱,你是白菜还是萝卜?) 的。