Re: cisco devices (General questions)
thanks, but i got it worked out from another post. Here is the code thats works --
Module Module1
Dim WithEvents ssh As New WeOnlyDo.Client.SSH
Dim fs As New FileStream( c:config.txt , FileMode.Append, FileAccess.Write)
Dim sw As New StreamWriter(fs)
Dim s As String
Sub Main()
With ssh
.Hostname = 1.1.1.1
.Login = username
.Password = password
.Command = sh run & vbCrLf
.Protocol = ssh.SupportedProtocols.SSHAuto
.Encryption = ssh.EncryptionMethods.Auto
.Connect()
End With
Do
Loop Until ssh.State = WeOnlyDo.Client.SSH.States.Disconnected
End Sub
Private Sub ssh_DataReceivedEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.SSH.DataReceivedArgs) Handles ssh.DataReceivedEvent
s = ssh.Receive
sw.Write(s)
End Sub
Private Sub ssh_DisconnectedEvent(ByVal Sender As Object, ByVal Args As System.EventArgs) Handles ssh.DisconnectedEvent
sw.Close()
fs.Close()
MsgBox(ssh.State.ToString, MsgBoxStyle.Information, disconnect event )
End Sub
End Module
Complete thread:
- cisco devices - epoelke, 2005-02-03, 02:20
- Re: cisco devices - wodSupport, 2005-02-03, 10:02
- Re: cisco devices - epoelke, 2005-02-03, 21:18
- Re: cisco devices - wodSupport, 2005-02-03, 22:01
- Re: cisco devices - epoelke, 2005-02-03, 23:01
- Re: cisco devices - wodSupport, 2005-02-03, 22:01
- Re: cisco devices - epoelke, 2005-02-03, 21:18
- Re: cisco devices - wodSupport, 2005-02-03, 10:02