Implements the functionality of a Rexec client.

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

Syntax

C#
[SerializableAttribute]
public class Rexec : Component
Visual Basic
<SerializableAttribute> _
Public Class Rexec _
	Inherits Component
Visual C++
[SerializableAttribute]
public ref class Rexec : public Component

Remarks

Note: Some systems limit the username to eight (8) characters or less. The Telnet Factory for .NET implementation does not restrict the length of usernames. If you have difficulty logging in to a Remote Host using a non-truncated username, try using the username truncated to 8 characters.

Rexec requires Remote Host authorization to execute the command. This is accomplished using a combination of two system files, hosts.equiv and .rhosts, depending on your system. Consult your system documentation for more information about managing remote logins.

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, port, username and password parameters.
CopyC#
Rexec rexec = new Rexec("hostname", port, "username", "password", "ls -al");
byte[] response = rexec.Execute();
string data = rexec.Encoding.GetString(response);
Console.WriteLine(data);

Copy 
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)

Inheritance Hierarchy

See Also