Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# equivalent to C `system()` standard library function

Tags:

c++

c#

wpf

c#-4.0

I developed a C++ program which utilises an .exe file through the following code:

system (TestApplication input.txt > output.txt )

TestApplication is the exe here. input.txt is the file in the same project directory, and output.txt is generated in the same directory through the program.

I have to something similar to above in C# Gui (WPF) application. What's the substitute class for `system' in C# and how do we perform the same operation?

like image 281
Cipher Avatar asked Dec 08 '25 19:12

Cipher


1 Answers

System.Diagnostics.Process class represents the process in OS, and allows you to create new processes. See http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx for an example of what you're trying to do.

like image 55
penartur Avatar answered Dec 11 '25 08:12

penartur



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!