繁体   English   中英

在Visual Studio中运行作为资源添加的exe文件

[英]Run exe file added as resource in visual studio

简单地说,我已经将视觉工作室项目的资源添加为exe文件。 我该如何运行这个文件? 我在c#中编码。

您可以将Resource作为byte []

byte[] myResBytes = ...;
Assembly asm = Assembly.Load(myResBytes);
// search for the Entry Point
MethodInfo method = asm.EntryPoint;
if(method == null) throw new NotSupportedException();
// create an instance of the Startup form Main method
object o = asm.CreateInstance(method.Name);
// invoke the application starting point
method.Invoke(o, null);

另请参阅此处了解更多详情

希望这可以帮助

您必须使用Process.Start方法。 msdn中看到它

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM