示例#1
0
 public ASRHyperVReplicaAzureOsDetails(OSDetails hyperVOsSetails)
 {
     this.OsType         = hyperVOsSetails.OsType;
     this.ProductType    = hyperVOsSetails.ProductType;
     this.OsEdition      = hyperVOsSetails.OsEdition;
     this.OSVersion      = hyperVOsSetails.OSVersion;
     this.OSMinorVersion = hyperVOsSetails.OSMinorVersion;
     this.OSMajorVersion = hyperVOsSetails.OSMajorVersion;
 }
示例#2
0
        public static OSDetails GetOSDetails()
        {
            //Get Operating system information.
            OperatingSystem os = Environment.OSVersion;
            //Get version information about the os.
            Version vs     = os.Version;
            var     detail = new OSDetails();

            if (os.Platform == PlatformID.Win32Windows)
            {
                //This is a pre-NT version of Windows
                switch (vs.Minor)
                {
                case 0:
                    detail.Description = OSDescription.Win95;
                    break;

                case 10:
                    if (vs.Revision.ToString() == "2222A")
                    {
                        detail.Description = OSDescription.Win98SE;
                    }
                    else
                    {
                        detail.Description = OSDescription.Win98;
                    }
                    break;

                case 90:
                    detail.Description = OSDescription.WinMe;
                    break;

                default:
                    break;
                }
            }
            else if (os.Platform == PlatformID.Win32NT)
            {
                switch (vs.Major)
                {
                case 3:
                    detail.Description = OSDescription.WinNT351;
                    break;

                case 4:
                    detail.Description = OSDescription.WinNT40;
                    break;

                case 5:
                    if (vs.Minor == 0)
                    {
                        detail.Description = OSDescription.Win2000;
                    }
                    else
                    {
                        detail.Description = OSDescription.WinXP;
                    }
                    break;

                case 6:
                    if (vs.Minor == 0)
                    {
                        detail.Description = OSDescription.WinVista;
                    }
                    else
                    {
                        detail.Description = OSDescription.Win7;
                    }
                    break;

                default:
                    break;
                }
            }

            detail.ServicePack  = os.ServicePack;
            detail.Architecture = GetOSArchitecture();

            return(detail);
        }