Esempio n. 1
0
        // Init OSVersionInfo object by current windows environment
        public static OSVersionInfo GetOSVersionInfo()
        {
            OperatingSystem osVersionObj = Environment.OSVersion;

            OSVersionInfo osVersionInfo = new OSVersionInfo()
            {
                Name  = GetOSName(osVersionObj),
                Major = osVersionObj.Version.Major,
                Minor = osVersionObj.Version.Minor,
                Build = osVersionObj.Version.Build
            };

            return(osVersionInfo);
        }
Esempio n. 2
0
 public static string GetWindowsVersion()
 {
     // https://docs.microsoft.com/en-us/windows/desktop/SysInfo/operating-system-version
     // https://stackoverflow.com/a/37700770/2350244
     return(OSVersionInfo.GetOSVersionInfo().FullName);
 }