75 |
75 |
stringBuilder = new StringBuilder();
|
76 |
76 |
GetPrivateProfileString("Internal", "IP", "", stringBuilder, 512, Path.Combine(AppDataFolder, "MARKUS.ini"));
|
77 |
77 |
string internal_ip = stringBuilder.ToString();
|
78 |
|
result = result.Replace(internal_ip, external_ip);
|
|
78 |
|
|
79 |
//internalport:externalport
|
|
80 |
stringBuilder = new StringBuilder();
|
|
81 |
GetPrivateProfileString("PortForwarding", "HUB", "", stringBuilder, 512, Path.Combine(AppDataFolder, "MARKUS.ini"));
|
|
82 |
string[] forwarding_hub = stringBuilder.ToString().Split(':');
|
|
83 |
stringBuilder = new StringBuilder();
|
|
84 |
GetPrivateProfileString("PortForwarding", "RESOURCE", "", stringBuilder, 512, Path.Combine(AppDataFolder, "MARKUS.ini"));
|
|
85 |
string[] forwarding_resource = stringBuilder.ToString().Split(':');
|
|
86 |
stringBuilder = new StringBuilder();
|
|
87 |
GetPrivateProfileString("PortForwarding", "BASE", "", stringBuilder, 512, Path.Combine(AppDataFolder, "MARKUS.ini"));
|
|
88 |
string[] forwarding_base = stringBuilder.ToString().Split(':');
|
|
89 |
|
|
90 |
if(result.Contains(internal_ip))
|
|
91 |
result = result.Replace(internal_ip, external_ip);
|
|
92 |
if(result.Contains(":" + forwarding_hub[0]))
|
|
93 |
result = result.Replace(":" + forwarding_hub[0], ":" + forwarding_hub[1]);
|
|
94 |
if (result.Contains(":" + forwarding_resource[0]))
|
|
95 |
result = result.Replace(":" + forwarding_resource[0], ":" + forwarding_resource[1]);
|
|
96 |
if (result.Contains(":" + forwarding_base[0]))
|
|
97 |
result = result.Replace(":" + forwarding_base[0], ":" + forwarding_base[1]);
|
79 |
98 |
}
|
80 |
99 |
return result;
|
81 |
100 |
}
|