Question

I'm not even sure whether I've framed this question correctly. Let me explain my situation.

I have an Application hosted in a OpenVMS environment which is being accessed via Telnet. I'm in need to programmatically accomplish certain tasks.

So far I could send and receive messages using a C# Telnet Client. I am able to execute tasks by sending commands and receiving responses. But for one task, I have to edit a Form to change some information. The command looks like below

>modify page <page_no>

As soon as I enter the above command, the entire terminal gets loaded with this Form, I have to use page-down to go through the fields, press enter to edit the text and use Ctrl-Z to save it.

I'm not sure how to accomplish this task programmatically.

I'm not familiar with telnet or VxWorks. I'm not sure the above is a feature of Telnet or OpenVMS. Kindly help.

Was it helpful?

Solution

This should be easy to figure out thanks to the clear text of telnet :D It shouldn't matter what platform your target is running. All you have to remember is that special keys like ctrl-z or page down, are just chars in the data stream. Ctrl-z is typically 0x1a, and I am not sure what page down is off the top of my head, but here is how you can figure it out:

  1. Get wireshark http://www.wireshark.org/ and install it if you don't already have it.
  2. Start wireshark up and capture all traffic on your NIC that will carry the connection to the target.
  3. Start a normal telnet session to the target and issue all of the commands (including the page downs and the ctrl-z).
  4. Stop wireshark capture and then filter out everything except telnet communication between you and the target.
  5. Look at the data that was sent to issue the ctrl-z, and page downs.
  6. Put those chars in your telnet stream when you are ready to issue those commands.

Easy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top