Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: SshNet: Connect to port 23 (telnet)

$
0
0
Hi Everyone,

I am trying to make a simple program written in visual basic 2010. Its purpose is to be able to issue unix commands and display the result. The code below works when I connect to Port 22, but when I changed it to Port 23, and run the program, it will hang and does not respond. I am sure that my connection info is correct.
Dim connInfo As New Renci.SshNet.PasswordConnectionInfo("SvrIP", 22, "Usr", "Pwrd")
Dim sshClient As New Renci.SshNet.SshClient(connInfo)

Dim Fsystem, FreeGB, PerFree As Renci.SshNet.SshCommand

Using sshClient
 sshClient.Connect()
 If sshClient.IsConnected Then
               
  Fsystem = sshClient.RunCommand("df -g |awk '{print $1}'") '("bdf |awk '{print FS_USED $1}'")
   
  lblOut1.Text = Fsystem.Result
 Else
   'some code....
 End If
  sshClient.Disconnect()

End Using
Thank you for taking the time to read, I hope somebody could help...
  • Kat

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>