Embed and reference an EXE in c#

余生颓废 提交于 2019-12-11 03:42:03

问题


I am looking to create and call a reference to a compiled .net exe file in a c# program and spawn it from my C# while outputting a single .exe.

Is this possible or am I wasting my time?


回答1:


I'm not sure if it is what you need, but you can reference any dotnet exe just as you would reference a dll. The target platform (x86, x64) must be the same if set in the referenced exe.




回答2:


You might be looking for the Process.Start:

Process myProc;

// Start the process.
myProc = Process.Start("C:\path\to\yourexecutable.exe");

//The process does something.
//...

// Stop the process.
myProc.CloseMainWindow();

However, I'm not following on the "embed" part. What are you trying to embed? What does "outputting a single .exe" mean?




回答3:


This might of some interest to you :

http://blogs.msdn.com/b/microsoft_press/archive/2010/02/03/jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx



来源:https://stackoverflow.com/questions/8068013/embed-and-reference-an-exe-in-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!