Telnet Factory for .NET

Rexec Constructor ()

Creates a new Rexec instance.

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,

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

Example

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.

[C#]
Rexec rexec = new Rexec();
rexec.Hostname = "hostname";
rexec.Username = "username";
rexec.Password = "password";
rexec.Command = "ls -al";
rexec.Execute();

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

Rexec Class | Jscape.Telnet Namespace | Rexec Constructor Overload List