Telnet Factory for .NET

Rsh Class

Implements the functionality of an Rsh client.

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

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

public class Rsh : 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.

Rsh 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 and user for the hostname and username parameters.

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

[Visual Basic]
Private WithEvents rsh As Rsh
rsh = New Rsh
Dim response As Byte() = rsh.Execute("hostname", "username", "ls -al")
Dim data As String = rsh.Encoding.GetString(response)
Console.WriteLine(data)

Requirements

Namespace: Jscape.Telnet

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

See Also

Rsh Members | Jscape.Telnet Namespace