如何将exe文件放在资源文件中,并在程序中使用
将exe文件放在资源文件中,在按下Button后运行此文件
求具体代码
------解决方案--------------------
------解决方案--------------------        [STAThread]
       static void Main(string[] args)
       {
           Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("NameSpace.Resources.Your.exe");
           byte[] bs = new byte[stream.Length];
           stream.Read(bs, 0, (int)stream.Length);
           Assembly asm = Assembly.Load(bs);
           MethodInfo info = asm.EntryPoint;
           ParameterInfo[] parameters = info.GetParameters();
           if ((parameters != null) && (parameters.Length > 0))
               info.Invoke(null, (object[])args);
           else
               info.Invoke(null, null);
       }
如果用到了Your.exe.config文件,注意要改成外部的out.exe.config,才不会出错