DotNet - Windows 2016 identifizieren
Hi,
wie kann man - ohne WMI - und "elegant"/einfach mit DotNet ein Windows Server 2016 identifizieren?
liefert sowohl bei Win2012 R2 als auch bei Win2016 jeweils "6.2.9200.00".
E.
wie kann man - ohne WMI - und "elegant"/einfach mit DotNet ein Windows Server 2016 identifizieren?
System.Environment.OSVersion.Version
liefert sowohl bei Win2012 R2 als auch bei Win2016 jeweils "6.2.9200.00".
E.
Please also mark the comments that contributed to the solution of the article
Content-Key: 334172
Url: https://administrator.de/contentid/334172
Printed on: April 19, 2024 at 10:04 o'clock
3 Comments
Latest comment
Aus der Registry z.B.
c#
hauruck
c#
string ProductName = Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","ProductName","")
string CurrentVersion = Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","CurrentVersion","")
liefert sowohl bei Win2012 R2 als auch bei Win2016 jeweils "6.2.9200.00".
https://msdn.microsoft.com/de-de/library/system.environment.osversion(v= ...Starting with Windows 8, the P:System.Environment.OSVersion property returns the same major and minor version numbers for all Windows platforms. Therefore, we do not recommend that you retrieve the value of this property to determine the operating system version.
Ist trotzdem bescheuert was Microsoft sich da leistet, dann sollten sie zumindest den Wert bei neueren OS ganz weg lassen oder auf Null setzen anstatt falsche Daten auszugeben. Redmondsche Denke hat noch nie einer kapiert...