Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Closed Unassigned: SSHNet and Visual basic- login [1882]

$
0
0
Hello! I work for a company called GGServers, and we sell minecraft hosting. What I'm currently working on, is an application in VB to streamline the process of ssh remote management. What this program will do, is instead of having to type commands in something like PuTTY, You click buttons to run commonly used commands, like htop to show the hardware monitor, and others to delete files, or restart Multicraft daemons.
The problem I'm currently running into is the actual login part of this. here's some examples of what I've got going on.

The Interface: http://puu.sh/6FQ5J.png
```
Public Class ggsmain

Public Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click

Dim connInfo As New Renci.SshNet.PasswordConnectionInfo(hostname.Text.ToString, usrname.Text.ToString, password.Text.ToString)
Dim sshClient As New Renci.SshNet.SshClient(connInfo)
Try
Using sshClient
sshClient.Connect()
End Using
Catch ex As Exception
cmds.Visible = True
End Try
End Sub

Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim connInfo As New Renci.SshNet.PasswordConnectionInfo(hostname.Text.ToString, usrname.Text.ToString, password.Text.ToString)
Dim sshClient As New Renci.SshNet.SshClient(connInfo)
Using sshClient

Dim cmd As Renci.SshNet.SshCommand
cmd = sshClient.RunCommand("htop")
output.Text = cmd.Result
End Using
End Sub
End Class
```

and finally, the error output:
With port appended to hostname:
```
A first chance exception of type 'System.ArgumentException' occurred in Renci.SshNet.dll
A first chance exception of type 'Renci.SshNet.Common.SshConnectionException' occurred in Renci.SshNet.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'Renci.SshNet.Common.SshConnectionException' occurred in Renci.SshNet.dll
A first chance exception of type 'System.ArgumentException' occurred in Renci.SshNet.dll
A first chance exception of type 'System.ArgumentException' occurred in Renci.SshNet.dll
(the more detailed error output) http://puu.sh/6FQbm.png
```
and without the port appended:

http://puu.sh/6FQfR.png (it doesn't show the output window for some reason, like the other)

Note that I can connect to the host with the information I used in my app in PuTTY and send commands normally.

Considering my at best intermediate level of proficiency in VB, I should probably not be attempting this, however I learn fast, and am Self taught in VB- never took classes for it. I literally installed it and played around with it until I was able to build multimedia applications(music player using wmp object and playlist support)
I feel like if I can get a little insight with this issue, I would be able to pick it up. Once I get the application to connect, and hold said connection open, I can then begin to add more commands to send to ssh host, and print them to the big black box(label) on the form

Thanks for your time, and I hope someone is able to help me. I'll be happy to provide more information if necessary
Comments: No feedback from submitter.

Viewing all articles
Browse latest Browse all 1026

Trending Articles



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