我在operation.cs中声明了一个枚举类型:
public enum order
{
NewAccount,
FindAccount
}
在test.cs中使用的时候报错:
public class test
{
public static void Main(String[] args)
{
order operationOrder;
Console.WriteLine(operationOrder.NewAccount);
}
}
无法使用实例引用访问静态成员“order.NewAccount”;改用类型名来限定它
问题补充: 刚刚那个问题已经解决,现在我想这么用: order operationOrder; switch (operationOrder) { case order.NewAccount: Bank bank1 = new Bank(); Console.WriteLine("请输入姓名:"); string name = Console.ReadLine(); Console.WriteLine("请输入身份证号码:"); string identityCard = Console.ReadLine(); string blance = Console.ReadLine(); break; case order.FindAccount: Console.WriteLine("待开发"); } 请为该怎么为operationOrder赋值?
POPMUISE
相关分类