I need a complete code/function/program that I can use in my VB.Net 2005 program to login into a UNIX box & call a Shell script.
I have a function waitfor(login: ) (where login is the prompt which I will get after telnet). This will wait for login: on the telnetted machine and then fire some command. But that prompt is not coming. The code that I am using is:
Sub Main ()
Dim ip As String = "xx.xx.xx.xx"
Dim port As Integer = 23
Dim timeout As Integer = 100
'create the object supplying the parameters
Dim session As New ScriptingTelnet(ip, port, timeout)
Dim connected As Boolean = session.Connect() 'try to connect
If connected = True Then
Dim startingPrompt As Integer = session.WaitFor("login:")
If startingPrompt = 0 Then
'the username prompt was found so we send the username
'and wait to receive our password prompt
session.SendAndWait("vvvv", "password: ")
'now send the password and wait for our next prompt
'in this sample I expect to receive a success message
Console.WriteLine("Username prompt was not found")
Console.WriteLine("Unable to connect to the server")
But whenever I try to login the string that I am getting is ??_??_??#??'??$. I am not getting what is it so cant proceed. Please help!
Above program is a Console Program. Once this is done I can convert it to GUI programming, API anyone can download from the gven path.
Please help me in developing this&&..
if using socket programming I try to do this then how can I? and what all I have to set up on the SERVER side