public static void Emit(StreamWriter m_outFile, Win32OperatingSystem aaaaa) { MemoryStream stream1 = new MemoryStream(); BinaryFormatter formatter1 = new BinaryFormatter(); // formatter1.set_AssemblyFormat(0); formatter1.AssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple; Console.WriteLine("Serialising the parser"); //formatter1.Serialize(stream1, aaaaa.dictionOSType); //formatter1.Serialize(stream1, aaaaa.dictionOSLanguage); //formatter1.Serialize(stream1, aaaaa.dictionOSProductSuite); //formatter1.Serialize(stream1, aaaaa.dictionSuiteMask); stream1.Position = 0; int num1 = 0; for (int num2 = 0; num2 < stream1.Length; num2++) { int num3 = stream1.ReadByte(); if (num1++ == 10) { m_outFile.WriteLine(); num1 = 0; } m_outFile.Write("{0},", num3); } m_outFile.WriteLine("0};"); }
public IActionResult Index() { return(Json(Win32OperatingSystem.Retrieve())); }
protected override void FillFloppyDriveInfo() { ManagementObjectCollection moc = this.GetAllInfo(this.WSql); foreach (ManagementObject mo in moc) { Win32OperatingSystem csp = new Win32OperatingSystem(); if (mo != null) { csp.BootDevice = GetManagementObject <string>(mo, "BootDevice"); csp.BuildNumber = GetManagementObject <string>(mo, "BuildNumber"); csp.BuildType = GetManagementObject <string>(mo, "BuildType"); csp.Caption = GetManagementObject <string>(mo, "Caption"); csp.CodeSet = GetManagementObject <string>(mo, "CodeSet"); csp.CountryCode = GetManagementObject <string>(mo, "CountryCode"); csp.CreationClassName = GetManagementObject <string>(mo, "CreationClassName"); csp.CSCreationClassName = GetManagementObject <string>(mo, "CSCreationClassName"); csp.CSDVersion = GetManagementObject <string>(mo, "CSDVersion"); csp.CSName = GetManagementObject <string>(mo, "CSName"); csp.CurrentTimeZone = GetManagementObject <short>(mo, "CurrentTimeZone"); csp.DataExecutionPrevention_32BitApplications = GetManagementObject <bool>(mo, "DataExecutionPrevention_32BitApplications"); csp.DataExecutionPrevention_Available = GetManagementObject <bool>(mo, "DataExecutionPrevention_Available"); csp.DataExecutionPrevention_Drivers = GetManagementObject <bool>(mo, "DataExecutionPrevention_Drivers"); csp.DataExecutionPrevention_SupportPolicy = GetManagementObject <byte>(mo, "DataExecutionPrevention_SupportPolicy"); csp.Debug = GetManagementObject <bool>(mo, "Debug"); csp.Description = GetManagementObject <string>(mo, "Description"); csp.Distributed = GetManagementObject <bool>(mo, "Distributed"); csp.EncryptionLevel = GetManagementObject <uint>(mo, "EncryptionLevel"); csp.ForegroundApplicationBoost = GetManagementObject <byte>(mo, "ForegroundApplicationBoost"); csp.FreePhysicalMemory = GetManagementObject <ulong>(mo, "FreePhysicalMemory"); csp.FreeSpaceInPagingFiles = GetManagementObject <ulong>(mo, "FreeSpaceInPagingFiles"); csp.FreeVirtualMemory = GetManagementObject <ulong>(mo, "FreeVirtualMemory"); csp.Cim_InstallDate = GetManagementObject <string>(mo, "InstallDate"); csp.LargeSystemCache = GetManagementObject <uint>(mo, "LargeSystemCache"); csp.Cim_LastBootUpTime = GetManagementObject <string>(mo, "LastBootUpTime"); csp.Cim_LocalDateTime = GetManagementObject <string>(mo, "LocalDateTime"); csp.Locale = GetManagementObject <string>(mo, "Locale"); csp.Manufacturer = GetManagementObject <string>(mo, "Manufacturer"); csp.MaxNumberOfProcesses = GetManagementObject <uint>(mo, "MaxNumberOfProcesses"); csp.MaxProcessMemorySize = GetManagementObject <ulong>(mo, "MaxProcessMemorySize"); csp.MUILanguages = GetManagementObject <string[]>(mo, "MUILanguages"); csp.Name = GetManagementObject <string>(mo, "Name"); csp.NumberOfLicensedUsers = GetManagementObject <uint>(mo, "NumberOfLicensedUsers"); csp.NumberOfProcesses = GetManagementObject <uint>(mo, "NumberOfProcesses"); csp.NumberOfUsers = GetManagementObject <uint>(mo, "NumberOfUsers"); csp.Organization = GetManagementObject <string>(mo, "Organization"); csp.OSArchitecture = GetManagementObject <string>(mo, "OSArchitecture"); csp.OSLanguage = GetManagementObject <uint>(mo, "OSLanguage"); csp.OSProductSuite = GetManagementObject <uint>(mo, "OSProductSuite"); csp.OSType = GetManagementObject <uint>(mo, "OSType"); csp.OtherTypeDescription = GetManagementObject <string>(mo, "OtherTypeDescription"); csp.PAEEnabled = GetManagementObject <bool>(mo, "PAEEnabled"); csp.PlusProductID = GetManagementObject <string>(mo, "PlusProductID"); csp.PlusVersionNumber = GetManagementObject <string>(mo, "PlusVersionNumber"); csp.Primary = GetManagementObject <bool>(mo, "Primary"); csp.ProductType = GetManagementObject <uint>(mo, "ProductType"); csp.QuantumLength = GetManagementObject <byte>(mo, "QuantumLength"); csp.QuantumType = GetManagementObject <byte>(mo, "QuantumType"); csp.RegisteredUser = GetManagementObject <string>(mo, "RegisteredUser"); csp.SerialNumber = GetManagementObject <string>(mo, "SerialNumber"); csp.ServicePackMajorVersion = GetManagementObject <ushort>(mo, "ServicePackMajorVersion"); csp.ServicePackMinorVersion = GetManagementObject <ushort>(mo, "ServicePackMinorVersion"); csp.SizeStoredInPagingFiles = GetManagementObject <ulong>(mo, "SizeStoredInPagingFiles"); csp.Status = GetManagementObject <string>(mo, "Status"); csp.SuiteMask = GetManagementObject <uint>(mo, "SuiteMask"); csp.SystemDevice = GetManagementObject <string>(mo, "SystemDevice"); csp.SystemDirectory = GetManagementObject <string>(mo, "SystemDirectory"); csp.SystemDrive = GetManagementObject <string>(mo, "SystemDrive"); csp.TotalSwapSpaceSize = GetManagementObject <ulong>(mo, "TotalSwapSpaceSize"); csp.TotalVirtualMemorySize = GetManagementObject <ulong>(mo, "TotalVirtualMemorySize"); csp.TotalVisibleMemorySize = GetManagementObject <ulong>(mo, "TotalVisibleMemorySize"); csp.Version = GetManagementObject <string>(mo, "Version"); csp.WindowsDirectory = GetManagementObject <string>(mo, "WindowsDirectory"); csp.WOWEnvironment = GetManagementObject <bool>(mo, "WOWEnvironment"); ps.Add(csp); } } moc.Dispose(); }