Reputation: 13290
I'm almost finish with my project. I want to import an .exe file into the BIN>DEBUG or BIN>RELEASE folder and then in my C# WPF application, there would be a code to execute such .exe file when a button is pressed. How can I do this?
Additional: can I run such .exe fil in background of my C# WPF program[exe program]?
My case is this: I'm totally done in my project, as I;'ve stated above. It has a function for client socket for file transferring as well as a chat function using TCP/IP, but I just can't put the server socket codes because it conflicts with the chat function. So therefore, I'm just gonna call the server .exe file which has the server socket codes.
Upvotes: 0
Views: 441
Reputation: 157068
You can use the Process.Start
method to open an executable.
Process.Start("yourApp.exe");
In order to copy a file to the bin > debug on BUILD TIME, use Post Build Actions.
If you want to do that on runtime, use File.Copy
method.
File.Copy("C:\\fromPath\\yourApp.exe", "C:\\newFolder");
Upvotes: 1