1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public int[] intarry = {1,2,3,4};
 
/// <summary>
/// Host에 해당하는 intarry 값 가져오기
/// </summary>
protected int GetValue()
{
     int retvalue = ChkHost(Request.Url.Host);
 
     return intarry[retvalue];
}
 
/// <summary>
/// Host 체크하기
/// </summary>
public int ChkHost(string host)
{
     int i = 0;
     String[] hosts = {
          "www.a.com",
          "www.b.co.kr",
          "www.c.net",
          "www.d.com"
     };
 
     for (i = 0; i < hosts.Length; i++)
     {
          if (hosts[i].Equals(host)) break;
     }
     return i;
}
cs


+ Recent posts