internal static string ParseCanonicalName(string str,int start, int end, ref bool loopback) {
string res = null;
for (int i = end-1; i >= start; --i) {
if (str[i] >= 'A' && str[i] <= 'Z') {
res = str.Substring(start, end-start).ToLower(CultureInfo.InvariantCulture);
break;
}
if (str[i] == ':')
end = i;
}
if (res == null) {
res = str.Substring(start, end-start);
}
if (res == Localhost || res == Loopback) {
loopback = true;
return Localhost;
}
return res;
}
//