Login  
Search All Forums
Dart Home | PowerTCP Telnet for .NET | Custom Development Reply | PowerTCP Telnet for .NET Topics | Forums   
AuthorForum: PowerTCP Telnet for .NET
Topic: DisplayData(session.WaitFor.......
lroberts

From: Grand Rapids, MI USA
Posts: 13
Member Since: 03/24/06
posted July 29, 2006 3:27 AM

I am having an issue with the waitfor command not picking up on the data and moving on. 

This is the line of code:

 DisplayData(session.WaitFor("(yogi.grhq.gfs.com)# "))
    session.Send("acm canada" + Chr(10))

I took a screen pic of the telnet screen, here is what the screen looks like:
http://ic3.deviantart.com/fs11/i/2006/210/4/2/screen_by_voodoo_daddy.gif

Now this is where it gets strange, if I push the enter key while its sitting there, then it moves on and does the rest of the code. I can not seem to find the problem.

Any ideas?

Thank you.


lroberts

From: Grand Rapids, MI USA
Posts: 13
Member Since: 03/24/06
posted July 29, 2006 3:31 AM

Here is what more of the code looks like just in case you need to see it....

'Attempt to connect to server and wait for login prompt
    session.Connect(host)

    'If Login Prompt and Username are defined,wait for LoginPrompt and display result
    If ((Not loginPrompt = "") And (Not username = "")) Then
      DisplayData(session.WaitFor(loginPrompt))
    End If
    'Send Username
    session.Send(username + Chr(10))

    'If a Password Prompt and Password are defined, wait for LoginPrompt and display result
    If ((Not passwordPrompt = "") And (Not password = "")) Then
      DisplayData(session.WaitFor(passwordPrompt))
    End If
    'Send Password
    session.Send(password + Chr(10))

    ' *** Start To Send Commands To Structure ***

    ' Send acm canada

    DisplayData(session.WaitFor("(yogi.grhq.gfs.com)# "))
    session.Send("acm canada" + Chr(10))

    ' Send k
    DisplayData(session.WaitFor("Enter letter (? for help):"))
    session.Send("k")

    ' Send a
  
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 2, 2006 11:37 AM

What happens if you send a CRLF instead of just a bare LF?:

session.Send("acm canada" + vbCrlf)

or

session.Send("acm canada" + Chr(13) + Chr(10))

If that does not help, then try using the Trace event to debug the data that is being sent and received to see where it is hanging.

If that doesn't tell you what's going on, then post the relevant lines from the trace and I will see if I can tell.

Thanks!
voodooboo
larrylroberts@hotmail.com

From: Lowell, MI USA
Posts: 2
Member Since: 08/01/06
posted August 2, 2006 11:40 AM

Hey thanks. I have not thought of trying that. I will give a try and report back.

Thanks again!
lroberts

From: Grand Rapids, MI USA
Posts: 13
Member Since: 03/24/06
posted August 3, 2006 11:37 PM

Well I tried that however it had the same results. The problem is not the sending of ("acm canada"). The problem is before that. After it sends the password a prompt of "(yogi.grhq.gfs.com)#" shows up however the waitfor statement does not seem to pickup on this. 

Also I am not sure how to use that trace command in this code. I attempted to look up the information but it was not very detailed enough for me.

Hope I explained it better. :-)

Thank you
lroberts

From: Grand Rapids, MI USA
Posts: 13
Member Since: 03/24/06
posted August 3, 2006 11:58 PM

Ok I figured out how to trace all this and this is what I found....



Sent:<255><251>/3
Sent:<255><251>/31
Sent:<255><251>/24
Sent:<255><253>/3
Sent:<255><253>/1
Received:<255><253>/24<255><253> <255><253>#<255><253>'<255><253>$<255><253>/3<255><253>/31
Sent:<255><252>
Sent:<255><252>#
Sent:<255><252>'
Sent:<255><252>$
Sent:<255><250>/31/0P/0/24<255><240>
Received:<255><251>/3<255><251>/1
Received:<255><250>/24/1<255><240>
Sent:<255><250>/24/0tty<255><240>
Received:<255><253>/1<255><251>/5<255><253>!
Sent:<255><252>/1
Sent:<255><254>/5
Sent:<255><252>!
Received:/13/0/13/10/13/0/13/10Digital UNIX (yogi.grhq.gfs.com) (ttyp0)/13/0/13/10/13/0/13/0/13/10/13/0
Received:login:
Sent:acm/10
Received:acm/13/10
Received:Password:
Sent:Gordon/10
Sent:acm canada/10
Received:/13/10
Received:acm canada/13/10
Received:Last login: Thu Aug 3 23:55:34 from ECOOPERATOR.grhq/13/10/13/10
Received:Digital UNIX V4.0D (Rev. 878); Sat Feb 12 05:52:03 EST 2000 /13/10/13/10The installation software has successfully installed your system./13/10/13/10There are logfiles that contain a record of your installation./13/10These are:/13/10/13/10/9/var/adm/smlogs/install.cdf   - configuration description file/13/10/9/var/adm/smlogs/install.log   - general log file/13/10/9/var/adm/smlogs/install.FS.log - file system creation logs/13/10/9/var/adm/smlogs/setld.log    - log for the setld(8) utility/13/10/9/var/adm/smlogs/fverify.log   - verification log file/13/10/13/10/13/10You have new mail./13/10(yogi.grhq.gfs.com)# /13/10*** WARNING: No cursor control; can't do emulation: vt100/13/10*** Emulation has been set to 'None'/13/10/7*** /13/10*** Press any key to continue:

As you can see there is some sort of press any key showing up in there however this is not being shown on the display screen at all. Any ideas how to answer this? I tried putting a  session.Send(Chr(10)) right after sending the password information but no luck. No matter what I seem to do it won't move beyond that point till I hit a key myself.

Any ideas?

thanks!
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 3, 2006 11:59 PM


No problem. Just put the following code in your trace event to create a log file called "c:\trace.log", then zip the log up and email it to support@dart.com (if you post it here the characters will be altered)


Dim s As String
' If this us the result of an outgoing transmission, prepend the
  '  ' text with a right pointing arrow, otherwise use a left pointing
  '  ' arrow
  If e.Segment.Sent Then
    s += vbCrLf + "---> "
  Else
    s += vbCrLf + "<--- "
  End If
  s += e.Segment.ToString
  Dim Stream As New IO.FileStream("c:\trace.log", IO.FileMode.OpenOrCreate, IO.FileAccess.ReadWrite)
      Stream.Seek(0, IO.SeekOrigin.End)
      Stream.Write(System.Text.Encoding.Default.GetBytes(s.ToCharArray), 0, System.Text.ASCIIEncoding.ASCII.GetByteCount(s.ToCharArray))
      Stream.Close()
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 4, 2006 12:02 AM

Disregard my last post. I posted before I got your post. I think at this point it would be best if we took this off the forum. Please send us an email containing the info we need to connect to the same server you are using so that I can try it here.

Thanks.
lroberts

From: Grand Rapids, MI USA
Posts: 13
Member Since: 03/24/06
posted August 4, 2006 12:21 AM

Good news! GOT IT! 

This is what it took...

DisplayData(session.WaitFor("com)#"))
    session.Send("acm canada" + Chr(10))


    DisplayData(session.WaitFor("continue:"))
    session.Send(Chr(10))

Thanks for the direction on where to look!
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 4, 2006 9:30 AM

That's good to hear! Thanks for the followup.
willwon155
willwon155@gmail.com

From: Canada, USA
Posts: 1
Member Since: 08/09/19
posted August 9, 2019 2:00 AM

Achieve your goals using a digital marketing strategy and find a great way to expand your potential. This is the best way to build your audience and serve them the best they want.
Website: https://www.canadawebdevelopment.com/digital-marketing/
Reply | PowerTCP Telnet for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX