laroberts Posted July 6, 2005 Posted July 6, 2005 I need to find a way to pause to allow time for the TelNet connection to take place and then answer the user name and password when it asks for it. Right now this runs so fast that it goes right through it before the TelNet is ready. Can somebody please show me an example of how I can do this with the code below. Thank you Private Sub TelnetGuiApp_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load m_Socket = New ASOCKETLib.SocketClass m_Constants = New Constants m_Socket.Protocol = m_Constants.asPROTOCOL_TELNET 'Host For FTP Location Dim TXT_HOST As String TXT_HOST = "library.uah.edu" m_Socket.Connect(TXT_HOST, 23) TXT_RESULT.Text = m_Socket.LastError.ToString() & " (" & m_Socket.GetErrorDescription(m_Socket.LastError) & ")" ' User Name For Host Dim TXT_COMMAND As String TXT_COMMAND = "guest" m_Socket.SendString(TXT_COMMAND, 1) TXT_RESULT.Text = m_Socket.LastError.ToString() & " (" & m_Socket.GetErrorDescription(m_Socket.LastError) & ")" ' Password For Host Dim TXT_PASSWORD As String TXT_PASSWORD = "5345" m_Socket.SendString(TXT_PASSWORD, 1) TXT_RESULT.Text = m_Socket.LastError.ToString() & " (" & m_Socket.GetErrorDescription(m_Socket.LastError) & ")" End Sub Quote
Administrators PlausiblyDamp Posted July 6, 2005 Administrators Posted July 6, 2005 Could you not read the output from telnet and wait for the prompts before sending any data? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.