42
1
using System;
2
3
/// <summary>
4
/// 권한1 옵션
5
/// </summary>
6
public enum Auth1Type
7
{
8
None = 0
9
10
, Opt0 = 1
11
, Opt1 = 2
12
, Opt2 = 4
13
, Opt3 = 8
14
, Opt4 = 16
15
, Opt5 = 32
16
, Opt6 = 64
17
18
19
, Opt1_2 = 6
20
, Opt1_2_3 = 14
21
, Opt1_2_3_4 = 30
22
, Opt1_5 = 34
23
24
, OptAll = int.MaxValue
25
}
26
27
public class Program
28
{
29
public static void Main()
30
{
31
Console.WriteLine("----- Auth1Type ----");
32
Auth1Type typeAuth1 = Auth1Type.None;
33
34
typeAuth1 = Auth1Type.Opt1 | Auth1Type.Opt5;
35
36
Console.WriteLine("value : " + typeAuth1.GetHashCode());
37
Console.WriteLine("string : " + typeAuth1.ToString());
38
Console.WriteLine("Auth1Type.Opt1 : " + typeAuth1.HasFlag(Auth1Type.Opt1));
39
Console.WriteLine("Auth1Type.Opt2 : " + typeAuth1.HasFlag(Auth1Type.Opt2));
40
Console.WriteLine(" ");
41
}
42
}
Cached Result
----- Auth1Type ----
value : 34
string : Opt1_5
Auth1Type.Opt1 : True
Auth1Type.Opt2 : False
value : 34
string : Opt1_5
Auth1Type.Opt1 : True
Auth1Type.Opt2 : False