This is my code:
FileStream fs = new FileStream(@"C:\Documents and Settings\Berdoues\Mes
documents\VisualStudioProjects\Application_Test_Wi ndowsForm\LoadAssembly\CaptureControl.exe",FileMod e.Open);
BinaryReader br = new BinaryReader(fs);
byte[] byteload = br.ReadBytes(Convert.ToInt32(fs.Length));
fs.Close();
br.Close();
Assembly asm = Assembly.Load(byteload);
object o = asm.CreateInstance("CaptureControl");
MethodInfo mi = asm.EntryPoint;
if(mi != null)
{
mi.Invoke(o,null);
}
It doesn'work.
"capturecontrol" is the name of my assemble and the namespce of my class
I don't understand the parameter of mi.Invoke(?,?);
Thank you for your help and patience!
wavemill
"Daniel Jin" wrote:
after the assembly is loaded. Assembly.EntryPoint will give you the
entry point of your executable (the static Main), you can call Invoke
off of that to start the program.
"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com... > Hello!
>
> thank's for your answers.
>
> assembly.load, load but not run my program.
>
> I would like run my program directly from my memory.
>
> best regards,
>
> wavemill
>
> "Mattias Sjogren" wrote: