0 votes
by (650 points)
edited

Hi, Is there a way to have the ansi recording result as a plain text file that would be as a standard log ? The playback feature is great (and used) but some of ours users wish to be able to search in a more "readable" log.

Best regards, André

1 Answer

+1 vote
by (15.2k points)
edited
 
Best answer

Hi,

you can use VirtualTerminal.DataReceived event to log the text yourself. Use the DataReceivedEventArgs.StrippedData property to get plain text.

Telnet client = new Telnet("server");
VirtualTerminal vt = client.StartVirtualTerminal();
vt.DataReceived += new DataReceivedEventHandler(vt_DataReceived);
// ...

void vt_DataReceived(object sender, DataReceivedEventArgs e)
{
    Console.Write(e.StrippedData);
}

TerminalControl.DataReceived event works the same way.

...