[英]System.Reflection
let us consider im having an application AAA. 让我们考虑我有一个应用程序AAA。 From my application im loaded an assembly named as BBB.When im in BBB path, i need to get the AAA Assembly name at run time.
从我的应用程序我加载了一个名为BBB的程序集。当我在BBB路径中时,我需要在运行时获取AAA程序集名称。 how to accomplish this?
怎么做到这一点? Thanks in advance
提前致谢
The call to: 致电:
Assembly.GetExecutingAssembly()
will return the assembly it's written in (the currently executing assembly). 将返回它所写入的程序集(当前正在执行的程序集)。 Or in your case, maybe you'll need:
或者在你的情况下,也许你需要:
Assembly.GetEntryAssembly()
to get the executable assembly (the assembly that the application was started with). 获取可执行程序集(启动应用程序的程序集)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.