Executes a command on the Remote Host.

Namespace: Jscape.Telnet
Assembly: Jscape.Telnet (in Jscape.Telnet.dll) Version: 2.6.1.0

Syntax

C#
public byte[] Execute()
Visual Basic
Public Function Execute As Byte()
Visual C++
public:
array<unsigned char>^ Execute()

Return Value

Result, as byte array, from Remote Host.

Examples

This example returns the results of a directory listing command executed on the Remote Host. Substitute a valid Remote Host, port, username, and password for the hostname, username and password parameters.
CopyRexec Execute
Rexec rexec = new Rexec("hostname", "username", "password", "ls -al");
byte[] response = rexec.Execute();
string data = rexec.Encoding.GetString(response);
Console.WriteLine(data);

CopyRexec Execute
Private WithEvents rexec As Rexec
rexec = new Rexec("hostname", port, "username", "password", "ls -al")
Dim response As Byte() = rexec.Execute()
Dim data As String = rexec.Encoding.GetString(response)
Console.WriteLine(data)

See Also