Windows automate telnet

前端 未结 3 505
半阙折子戏
半阙折子戏 2021-02-07 05:33

I would like to run a set of commands that would typically be run in telnet(from c#).

For example I would like to run the following

using System;
using          


        
3条回答
  •  误落风尘
    2021-02-07 06:19

    Sending the information to telnet seems like it should be straightforward; use SendKeys(). The question becomes how to capture the output.

    I found this YouTube video that should help: https://www.youtube.com/watch?v=BDTCviA-5M8

    The solution in the video doesn't really address keeping the session open. I'm a bit outside my knowledge area here, but I believe you can start telnet in a worker thread, send commands to it with SendKeys(), capture the output as described in the video, then parse it.

    Does that sufficiently resolve the requirement?

提交回复
热议问题