G
Guest
Hi,
I have a Class1.cs and a Main executable file.
The main executable codes look like this:
Assembly asm = Assembly.LoadFile(@"C:\ClassLibrary1.dll");
Type typ = asm.GetType("INPTest.Class1");
MethodInfo mi = typ.GetMethod("Show");
mi.Invoke(asm, null);
The Class1.cs codes look like this:
public static void Show()
{
MessageBox.Show("Create Log");
}
If I remove the static from the Show method I will have the error message
displayed --> Object does not match target type.
Can anyone show some examples using the same concept without the static
keyword?
Thanks,
C# newbie
I have a Class1.cs and a Main executable file.
The main executable codes look like this:
Assembly asm = Assembly.LoadFile(@"C:\ClassLibrary1.dll");
Type typ = asm.GetType("INPTest.Class1");
MethodInfo mi = typ.GetMethod("Show");
mi.Invoke(asm, null);
The Class1.cs codes look like this:
public static void Show()
{
MessageBox.Show("Create Log");
}
If I remove the static from the Show method I will have the error message
displayed --> Object does not match target type.
Can anyone show some examples using the same concept without the static
keyword?
Thanks,
C# newbie