如何知道应用程序的.NET版本 [英] How to know .NET Version for the applcation

查看:94
本文介绍了如何知道应用程序的.NET版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在开发一个网络应用程序,其中我们有一个菜单,菜单项为"帮助",它将提供如第1页的信息。什么是服务器类型的服务器?
2。我主持的CPU类型是什么?在开发应用程序时使用的.NET版本(VS 2008或2005)是什么?
我可以获得1,2项,例如

Hi All,
i am developing a web application in which we had one Menu with Menuitem as Help which will give information like
1. What is the OS type of Server?
2. What is the CPU type i am hosting?
3. What is the .NET version (VS 2008 OR 2005) used in developing the application?
I am able to get 1,2 items like

string cpuType=System.Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER");
string OS = System.Environment.OSVersion.VersionString;


但是我怎样才能给出用于开发应用程序的.NET版本?

问候
Anil

But how can i give which .NET version used to develop the application?

Regards
Anil

推荐答案

System.Environment.Version将给出当前正在执行的.NET版本。 System.Reflection.Assembly.ImageRuntimeVersion将提供程序集清单中包含的.NET版本,但我认为您不能在各种版本的CLR 2.0之间获得任何粒度。我没有看到.NET反射器或ildasm中的任何元数据区分vs2005和vs2008。
System.Environment.Version will give the version of .NET currently executing.  System.Reflection.Assembly.ImageRuntimeVersion will give the .NET version contained in the assembly's manifest, but I don't think you can get any granularity between the various versions of CLR 2.0.  I don't see any metadata in .NET reflector or ildasm that differentiates vs2005 and vs2008.


这篇关于如何知道应用程序的.NET版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆