Creates a new Rexec instance.

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

Syntax

C#
public Rexec()
Visual Basic
Public Sub New
Visual C++
public:
Rexec()

Remarks

You must assign the hostname or IP address of the Remote Host, username, password, and command properties prior to invoking the Execute method.

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,

CopyC#
hosts.equiv
and
CopyC#
.rhosts
, depending on your system. Consult your system documentation for more information about managing remote logins.

Examples

To use an Rexec instance, assign the hostname or IP address, username, password, and command properties of the Rexec instance. By default, Port 512 will be used.
CopyRexec
Rexec rexec = new Rexec();
rexec.Hostname = "hostname";
rexec.Username = "username";
rexec.Password = "password";
rexec.Command = "ls -al";
rexec.Execute();

CopyRexec
Private WithEvents rexec As Rexec
rexec = new Rexec()
rexec.Hostname = "hostname"
rexec.Username = "username"
rexec.Password = "password"
rexec.Command = "ls -al"
rexec.Execute()

See Also