internal static bool IsDomainAddress (string name)
{
int len = name.Length;
int count = 0;
for (int i = 0; i < len; i++) {
char c = name [i];
if (count == 0) {
if (!Char.IsLetterOrDigit (c))
return false;
} else if (c == '.') {
count = 0;
} else if (!Char.IsLetterOrDigit (c) && c != '-' && c != '_') {
return false;
}
if (++count == 64)
return false;
}
return true;
}
#if !NET_2_1