protected bool login() { bool connected = false; try { IPEndPoint ip = new IPEndPoint(Dns.Resolve(ftpAddress).AddressList[0],ftpPort); //PORT = 21 socket.Connect(ip); //The error occurs in this statement } catch (Exception ex) { Debug.Write(ex.Message); } return connected; }
You can use SocketException.ErrorCode to obtain the specific error code. After you have obtained this code, refer to the Windows Sockets version 2 API error code documentation in the MSDN library for a detailed description of the error.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)