Visual Basic (Declaration) | |
---|---|
Public Sub Execute( _ ByVal username As String, _ ByVal password As String, _ ByVal command As String _ ) |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As Rexec Dim username As String Dim password As String Dim command As String instance.Execute(username, password, command) |
Managed Extensions for C++ | |
---|---|
public: void Execute( string* username, string* password, string* command ) |
Parameters
- username
- The login name of the user account.
- password
- The password of the user account.
- command
- The command to execute.
Use the Connect method to first connect to the remote host on the well-known port of 512. Then use Execute to authenticate using username and password and execute the command specified by command.
Use one of the Read methods to get the server's output.
When the server responds to a REXEC command, the first byte received indicates success/failure (0 for success, 1 for failure). When using the Rexec component, if the first byte is a 1 (meaning failure) an IOException is thrown. The Exception.Message will contain the response from the server without the first byte.
Target Platforms: Microsoft .NET Framework 2.0