Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ "system()" in C#

I am currently developing an application in C# which needs to work sort of like a "Command Prompt", therefore I was wondering whether the C++ function

int system ( const char * command ); 

in cstdlibexists in C#?

A reference to an dynamic-link library containing this function would be accepted aswell.

like image 411
Rasmus Søborg Avatar asked May 29 '12 20:05

Rasmus Søborg


People also ask

What is system () in C?

system() is used to invoke an operating system command from a C/C++ program. int system(const char *command); Note: stdlib. h or cstdlib needs to be included to call system. Using system(), we can execute any command that can run on terminal if operating system allows.

What does system in C return?

system() returns the exit code of the process you start.

Is system () safe to use?

Use of the system() function can result in exploitable vulnerabilities, in the worst case allowing execution of arbitrary system commands. Situations in which calls to system()have high risk include the following: When passing an unsanitized or improperly sanitized command string originating from a tainted source.

What is system CLS in C?

system. cls() function to clear console screen . This function is present in the standard library header file <stdlib. h.


1 Answers

Look into System.Diagnostics.Process.Start: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx

like image 130
qehgt Avatar answered Sep 22 '22 10:09

qehgt