Ajax
ASP
C,C++
C#,.NET
CSS,HTML
Delphi,Kylix
Experience
Flash
Java
JavaScript
PHP
Python
QT
SQL
ShellScript
VB
U :
P :
Register
Lost Password
Other Links
Code Archive
Save Giovanni
C#,.NET Category Code
Real Name
:
SharingCode.NET User
Subject
:
RSH sample - run a shell script on a remote UNIX host and read stderr and stdout
Description
:
Requirements:
Requires ASocket.dll to run the sample. Download it at http://www.vahland.com/asocket/asocket.dll
Comments:
RSH sample - run a shell script on a remote UNIX host and read stderr and stdout. Supply user nae if required. Requires a well configured .rhsot on the remote UNIX or LINUX machine.
// ******************************************************************** // RSH Remote Shell // Run the 'ls' command on 192.168.1.10, using default logged on user. // Requires ASocket.dll to run the sample. // Download it from http://www.vahland.com/asocket/asocket.dll // and register it (REGSVR32 asocket.dll) on your machine. // // IMPORTANT: // Online manual: http://www.vahland.com/asocket/manual.htm // ******************************************************************** static void Main(string[] args) { RSh objRSh = new RShClass(); asConstants objConstants = new asConstants(); objRSh.Clear(); objRSh.Host = "192.168.1.10"; objRSh.Command = "/bin/ls"; objRSh.ScriptTimeOut = 5000; Console.WriteLine( "Running command..." ); objRSh.Run(); Console.WriteLine( "Run, result: " + objRSh.LastError + " (" + objRSh.GetErrorDescription( objRSh.LastError ) + ")" ); if( objRSh.LastError == objConstants.asERR_SUCCESS ) { Console.WriteLine( "StdErr:" ); Console.WriteLine( objRSh.StdErr ); Console.WriteLine( "StdOut:" ); Console.WriteLine( objRSh.StdOut ); } Console.WriteLine( "Ready." ); System.Threading.Thread.Sleep(5000); }
Rating
:
5.00
(out of 5)
Visitor Voting Booth
:
Excellent
Very Good
Good
Fair
Poor
User Comments
sinu
09/05/2007 13:28
Not able to download the dll. can you please check and let me know.
Copyright © 2006 SharingCode.NET . All rights reserved. Hosted By: SisNetworks