private int GetPortV4(string responseString)
{
string[] parsedList = responseString.Split(new char[] { ' ', '(', ',', ')' });
// We need at least the status code and the port
if (parsedList.Length <= 7)
{
throw new FormatException(SR.Format(SR.net_ftp_response_invalid_format, responseString));
}
int index = parsedList.Length - 1;
// skip the last non-number token (e.g. terminating '.')
if (!Char.IsNumber(parsedList[index], 0))
index--;
int port = Convert.ToByte(parsedList[index--], NumberFormatInfo.InvariantInfo);
port = port |
(Convert.ToByte(parsedList[index--], NumberFormatInfo.InvariantInfo) << 8);
return port;
}