Hello, I would like to get rid of the commands I am executing on device. I have Windows user form and when I am sending commands to the switch in the output except the results or action which the application did on the device I also see commands / config. I want to get rid of them and show only result of these commands.
/*THIS IS THE SET OF COMMANDS I WANT TO RUN */
ssh2.ChannelSendString(channelNum, command, "ansi");
if (success != true)
{
if (x < 2)
{
output_box.Invoke((MethodInvoker)delegate
{
// Running on the UI thread
output_box.Text += "\r\n Execution of commands failed \r\n Running again ...\r\n";
tofile += "\r\n Session failed \r\n Running again ...\r\n ";
});
x++;
i--;
continue;
}
}
ssh2.ChannelSendEof(channelNum);
var cmdOutput = ssh2.ChannelReadAndPoll(channelNum, 2000);
var result = ssh2.GetReceivedText(channelNum, "ansi");
tofile += result;
output_box.Invoke((MethodInvoker)delegate {
// Running on the UI thread
output_box.Text += result;
});
So what I see in the output_box is this -> how do I get rid of the first four lines starting with ,,conf t" and ending with ,,end"
############### SWITCH ##################### - 1 of 2
conf t
vlan 20
name 20
end
SWITCH# conf t
Enter configuration commands, one per line. End with CNTL/Z.
SWITCH(config)# vlan 20
SWITCH(config-vlan)# name 20
SWITCH(config-vlan)# end
SWITCH#