Calling OS functions from with C# code

  • Thread starter Thread starter Meya-awe
  • Start date Start date
M

Meya-awe

Hi,
What does C# has to offer for calling system functions from within the
VS .NET C# project? I want to kickoff a script or a batch file from my
code.
thanks,
BRAMOIN
 
Bramoin,

What system function did you have in mind? You can use pretty any of
the functions in the Win32 API using P/Invoke and the DllImport
attribute. There is a Process class that can be used to spawn other
processes.

Brian
 
I want to invoke rsh from my code which runs a program on another
computer and returns the result. What object do i need to create to use
Invoke? I looked up and found Invoke and ManamentClass but it needs
System.Management which is not on my system, any ideas how to get that?
Is this too much work or using win32 is best?
thanks,
BRAMOIN
 
| Hi,
| What does C# has to offer for calling system functions from within the
| VS .NET C# project? I want to kickoff a script or a batch file from my
| code.
|

You don't need to call a system function, you need to use the framework
functionality.
You can start a script or batch file using
System.Diagnostics.Process.Start(), check the docs for details and samples.

Willy.
 
When rsh runs, it returns a result which is half a page worth of data.
is this returned to the program? What do i use to save the results?
Thanks,
BRAMOIN
 
Back
Top