TXT

enum example

By James Peterson,2014-05-19 11:10
20 views 0
enum example

using System;

    using System.Collections.Generic;

public class MyClass

    {

     public static void Main()

     {

     Console.WriteLine("you create new user is successed ");

     Console.WriteLine("User ID:"+CreateUser().UserID.ToString() +

    "\nUser Name:"+ CreateUser().UserName + "\nUser

    type:"+CreateUser().userType);

     Console.ReadLine();

     }

     ///

     /// ÓÃ??Ã??Ù

     ///

     public enum UserType

     {

     Administrator,

     Guset,

     Authorization,

     GeneralUser

     }

     ///

     /// ????ÓÃ??

     ///

     ///

     ///

     private static UserInfo CreateUser()

     {

     UserInfo user = new UserInfo();

     user.UserID = 01;

     user.UserName = "Shawdren";

     user.userType = UserType.Administrator;

     return user;

     }

     public class UserInfo

     {

     public int UserID {get;set;}

     public string UserName{get;set;}

     public UserType userType{get;set;}

     }

}

Report this document

For any questions or suggestions please email
cust-service@docsford.com