Im loading an Exe into my application using Assembly.LoadFile(). From that is it possible to get the Method of a particular class from that EXE. Thanks in advance .
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Try:
var assembly = Assembly.LoadFile("C:\path-to-some-app.exe");
var desiredType = assembly.GetType("SomeNamespace.SomeClass");
var methodInfo = desiredType.GetMethod("MethodName");
回答2:
A number of things you can do with Reflection (Including constructors, method invocation etc.) Tutorial at : http://www.csharp-examples.net/reflection-examples/