cisco devices - WeOnlyDo Discussion board

cisco devices (General questions)

by epoelke, Thursday, February 03, 2005, 02:20 (7232 days ago)

Has anyone written any code to pull cisco configs? I have attempted to and it seems the data received event never fires. I am new to programming and any help would be appreciated. here is the code --

Module Module1
Dim WithEvents ssh As New WeOnlyDo.Client.SSH
Sub Main()
ssh.Hostname = 1.1.1.1
ssh.Login = user
ssh.Password = password
ssh.Encryption = WeOnlyDo.Client.SSH.EncryptionMethods.Auto
ssh.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSHAuto
ssh.Blocking = True
ssh.Command = ( sh run & vbCrLf)
ssh.Connect()

End Sub
Private Sub ssh_ConnectedEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.SSH.ConnectedArgs) Handles ssh.ConnectedEvent
MsgBox( connected , MsgBoxStyle.Information, test )
End Sub

Private Sub ssh_DataReceivedEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.SSH.DataReceivedArgs) Handles ssh.DataReceivedEvent
Dim st As String
Dim fs As New FileStream( c:config.txt , FileMode.Create)
Dim s As New StreamWriter(fs)
st = ssh.Receive
s.Write(st)
End Sub
End Module


Complete thread: