コード例 #1
0
        public void Connect(ServerDetails sd)
        {
            if (sd == null)
            {
                return;
            }
            server = sd.Copy();

            string ip   = server.GetAddress();
            string user = server.GetUser();
            string pass = server.GetPass();

            sshClient = new SshClient(ip, user, pass);

            try
            {
                sshClient.Connect();
            }
            catch (SocketException ex)
            {
                Console.WriteLine("SocketException: " + ex.ErrorCode);
                return;
            }

            isConnected = sshClient.IsConnected;
        }