以编程方式获取DLL的版本号

问题描述:

是否可以从任何.NET DLL中以编程方式获取版本号?

Is it possible to get the version number programmatically from any .NET DLL?

如果是,怎么办?

Assembly assembly = Assembly.LoadFrom("MyAssembly.dll");
Version ver = assembly.GetName().Version;

重要提示:
请注意,这不是原始问题的最佳答案。不要忘记在此页面上阅读更多内容。

Important: It should be noted that this is not the best answer to the original question. Don't forget to read more on this page.