发送控制-N和< CR>< LF>.通过使用C#的telnet [英] Sending Control-N and <CR><LF> via telnet using C#
问题描述
我当前正在使用CodeProject上的简约Telnet,并且无法将正确的输出发送到我的telnet设备.本质上,我正在尝试使用此过程自动从Netopia DSL调制解调器收集配置数据.我能够阅读netopia telnet界面的欢迎屏幕,但是我无法再进一步了.
I am currently using minimalistic Telnet from CodeProject and am having trouble sending the correct output to my telnet device. Essentially I am trying to automate the gathering of config data from Netopia DSL modems using this process. I am able to read the welcome screen of the netopia telnet interface just fine however I can not get any further.
手动过程如下: 1)Telnet到设备ip 2)显示欢迎画面. 3)在欢迎屏幕上,按Control-N 4)出现#提示 5)sh config会将配置文件打印到屏幕上.
The process manually goes like this: 1) Telnet to device ip 2) A welcome screen is displayed. 3) While on the welcome screen, press Control-N 4) Presented with a # prompt 5) sh config would print the config file to the screen.
非常感谢您的帮助.
推荐答案
这些是ascii代码.
These are ascii codes.
char ctrln = (char)0x0E;
char cr = '\r';
char lf = '\n';
我还没有测试过ctrl + n,但是其他两项都可以工作.
I've not tested the ctrl+n one but the other two should work.
这篇关于发送控制-N和< CR>< LF>.通过使用C#的telnet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!