Vista based operating systems returns IPV6 addresses as the first address in the IPAddress list collection. I made new function to library (FTPConnection class)
private IPAddress GetLocalAddressIPV4()
{
IPAddress[] result = Dns.GetHostAddresses(System.Environment.MachineName);
for (int i = 0; i < result.Length; i++) {
if (result[i].AddressFamily == AddressFamily.InterNetwork) return result[i];
}
return null; //this is error and means that no IPV4 address found
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Vista based operating systems returns IPV6 addresses as the first address in the IPAddress list collection. I made new function to library (FTPConnection class)
private IPAddress GetLocalAddressIPV4()
{
IPAddress[] result = Dns.GetHostAddresses(System.Environment.MachineName);
for (int i = 0; i < result.Length; i++) {
if (result[i].AddressFamily == AddressFamily.InterNetwork) return result[i];
}
return null; //this is error and means that no IPV4 address found
}
Sorry about the typo in subject.