【问题标题】:Using reflection to determine assembly module type使用反射来确定程序集模块类型
【发布时间】:2009-04-07 11:45:03
【问题描述】:

如何使用 .net 反射来确定正在执行的程序集的类型,我的意思是 dll 或 exe。目前它可以做类似的事情:

Assembly.GetExecutingAssembly().CodeBase.ToLower.EndsWith(".exe")

但似乎可以存在不需要进行字符串比较的更好的东西,即比较程序集模块名称也属于这一类。

【问题讨论】:

    标签: .net reflection .net-assembly


    【解决方案1】:

    对此不是 100% 确定,但我认为 Assembly.EntryPoint 对于 DLL 来说是空的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多