개정판 84c48033
issue #000: daelim merged(settings =>ini) 내/외부 구분 하여 api url 을 리턴하도록 Commonlib 추가. daelim ini 추가
Change-Id: I2904309621897cda96f9537982fbd6e53874be29
CommonLib/Common.cs | ||
---|---|---|
37 | 37 |
} |
38 | 38 |
|
39 | 39 |
/// <summary> |
40 |
/// isExternal 이 True 이면 Internal IP를 External 로 치환하여 Return |
|
41 |
/// </summary> |
|
42 |
/// <param name="section"></param> |
|
43 |
/// <param name="key"></param> |
|
44 |
/// <param name="def"></param> |
|
45 |
/// <param name="isExternal"></param> |
|
46 |
/// <returns></returns> |
|
47 |
public static string GetConfigString(string section, string key, string def,bool isExternal) |
|
48 |
{ |
|
49 |
System.Text.StringBuilder strbuilder = new System.Text.StringBuilder(512); |
|
50 |
GetPrivateProfileString(section, key, def, strbuilder, 512, Path.Combine(AppDataFolder, "MARKUS.ini")); |
|
51 |
|
|
52 |
string result = strbuilder.ToString(); |
|
53 |
//internal 이면 result return |
|
54 |
if (isExternal) |
|
55 |
{ |
|
56 |
System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(512); |
|
57 |
GetPrivateProfileString("External", "IP", "", stringBuilder, 512, Path.Combine(AppDataFolder, "MARKUS.ini")); |
|
58 |
string external_ip = stringBuilder.ToString(); |
|
59 |
stringBuilder = new StringBuilder(); |
|
60 |
GetPrivateProfileString("Internal", "IP", "", stringBuilder, 512, Path.Combine(AppDataFolder, "MARKUS.ini")); |
|
61 |
string internal_ip = stringBuilder.ToString(); |
|
62 |
result = result.Replace(internal_ip, external_ip); |
|
63 |
} |
|
64 |
return result; |
|
65 |
} |
|
66 |
public static string GetAlertMessageString(string section, string key, string def) |
|
67 |
{ |
|
68 |
System.Text.StringBuilder strbuilder = new System.Text.StringBuilder(1024); |
|
69 |
GetPrivateProfileString(section, key, def, strbuilder, 1024, Path.Combine(AppDataFolder, "MARKUS.ini")); |
|
70 |
byte[] byte64 = Convert.FromBase64String(strbuilder.ToString()); |
|
71 |
|
|
72 |
return Encoding.UTF8.GetString(byte64); |
|
73 |
} |
|
74 |
/// <summary> |
|
40 | 75 |
/// 서버에 설치된 Service ini 의 Connection String 을 참조 |
41 | 76 |
/// </summary> |
42 | 77 |
/// <returns></returns> |
내보내기 Unified diff