

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21



//Dictionary 的用法
Dictionary<string, int> dic = new Dictionary<string, int>();
private int GetLevel(string id)
{
int num = 0;
foreach(KeyValuePair<string, int> d in dic)
{
if (d.Key.ToString() == id) {
num =Convert.ToInt32(d.Value);
}
}
return num;
}