.net – 确定已加载的程序集

前端之家收集整理的这篇文章主要介绍了.net – 确定已加载的程序集前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何确定我的.NET桌面应用程序已加载的所有程序集?我想将它们放在约框中,这样我就可以通过电话查询客户,以确定他们在PC上使用的XYZ版本.

很高兴看到托管和非托管程序集.我意识到列表会很长,但我打算对它进行增量搜索.

  1. using System;
  2. using System.Reflection;
  3. using System.Windows.Forms;
  4.  
  5. public class MyAppDomain
  6. {
  7. public static void Main(string[] args)
  8. {
  9. AppDomain ad = AppDomain.CurrentDomain;
  10. Assembly[] loadedAssemblies = ad.GetAssemblies();
  11.  
  12. Console.WriteLine("Here are the assemblies loaded in this appdomain\n");
  13. foreach(Assembly a in loadedAssemblies)
  14. {
  15. Console.WriteLine(a.FullName);
  16. }
  17. }
  18. }

猜你在找的Windows相关文章