C#从内存中加载带有参数的.NET程序集

use*_*973 1 c#

我想知道如何从带参数的字节数组中启动.NET程序集.我不想先把它写到磁盘上.谁能给我一个如何做到这一点的例子?谢谢.

Bau*_*uss 5

这应该可以解决问题.

Assembly program = Assembly.Load(ASSEMBLY_BYTES);

string[] args = new string[] { "-s" };

program.EntryPoint.Invoke(null, new object[] { args });
Run Code Online (Sandbox Code Playgroud)