Telnet Factory for .NET

Rexec Class

Implements the functionality of a Rexec client.

For a list of all members of this type, see Rexec Members.

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         Jscape.Telnet.Rexec

public class Rexec : Component

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

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.

Example

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.

[C#]
Rexec rexec = new Rexec("hostname", port, "username", "password", "ls -al");
byte[] response = rexec.Execute();
string data = rexec.Encoding.GetString(response);
Console.WriteLine(data);

[Visual Basic]
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)

Requirements

Namespace: Jscape.Telnet

Assembly: Jscape.Telnet (in Jscape.Telnet.dll)

See Also

Rexec Members | Jscape.Telnet Namespace