Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to telnet a HProCurve J9279A Switch but i am getting some unknown characters in the login prompt when i am writing the response in text file . Please let me know how to handle this and remove these junk characters from string . I can say these are some escape sequense which in not recognized by string .

Please register your products now at: www.ProCurve.com

Username: [?25h[?25h[?25h

Please help to remove thse unknown characters in above strings and command outputs. any help will be appreciated
Posted
Updated 12-Aug-14 19:24pm
v2

1 solution

That looks like VT100 escape codes (but I could be wrong, it's been a while since I needed to know things like this :)).

Get a VT100 ANSI parser library and feed the string to that, I'd try using the libvt100 C# library[^], it as an easy to use parse interface.

Or if you've got way too much time on your hands, hand-roll your own implementation according to a VT100 and VT52 escape codes chart[^].

Hope this helps,
Fredrik
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900