コード例 #1
0
        public static void Emit(StreamWriter m_outFile, Win32VideoController 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.dictionProtocolSupported);

            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};");
        }
コード例 #2
0
        static void Main(string[] args)
        {
            StreamWriter         sw = new StreamWriter("d:/f.txt");
            Win32VideoController a  = new Win32VideoController();

            //a.dictionProtocolSupported = new Dictionary<ushort, string>();
            //a.dictionProtocolSupported.Add(0, "");
            //a.dictionProtocolSupported.Add(1, "Other");
            //a.dictionProtocolSupported.Add(2, "Unknown");
            //a.dictionProtocolSupported.Add(3, "EISA");
            //a.dictionProtocolSupported.Add(4, "ISA");
            //a.dictionProtocolSupported.Add(5, "PCI");
            //a.dictionProtocolSupported.Add(6, "ATA/ATAPI");
            //a.dictionProtocolSupported.Add(7, "Flexible Diskette");
            //a.dictionProtocolSupported.Add(8, "1496");
            //a.dictionProtocolSupported.Add(9, "SCSI Parallel Interface");
            //a.dictionProtocolSupported.Add(10, "SCSI Fibre Channel Protocol");
            //a.dictionProtocolSupported.Add(11, "SCSI Serial Bus Protocol");
            //a.dictionProtocolSupported.Add(12, "SCSI Serial Bus Protocol-2 (1394)");
            //a.dictionProtocolSupported.Add(13, "SCSI Serial Storage Architecture");
            //a.dictionProtocolSupported.Add(14, "VESA");
            //a.dictionProtocolSupported.Add(15, "PCMCIA");
            //a.dictionProtocolSupported.Add(16, "Universal Serial Bus");
            //a.dictionProtocolSupported.Add(17, "Parallel Protocol");
            //a.dictionProtocolSupported.Add(18, "ESCON");
            //a.dictionProtocolSupported.Add(19, "Diagnostic");
            //a.dictionProtocolSupported.Add(20, "I2C");
            //a.dictionProtocolSupported.Add(21, "Power");
            //a.dictionProtocolSupported.Add(22, "HIPPI");
            //a.dictionProtocolSupported.Add(23, "MultiBus");
            //a.dictionProtocolSupported.Add(24, "VME");
            //a.dictionProtocolSupported.Add(25, "IPI");
            //a.dictionProtocolSupported.Add(26, "IEEE-488");
            //a.dictionProtocolSupported.Add(27, "RS232");
            //a.dictionProtocolSupported.Add(28, "IEEE 802.3 10BASE5");
            //a.dictionProtocolSupported.Add(29, "IEEE 802.3 10BASE2");
            //a.dictionProtocolSupported.Add(30, "IEEE 802.3 1BASE5");
            //a.dictionProtocolSupported.Add(31, "IEEE 802.3 10BROAD36");
            //a.dictionProtocolSupported.Add(32, "IEEE 802.3 100BASEVG");
            //a.dictionProtocolSupported.Add(33, "IEEE 802.5 Token-Ring");
            //a.dictionProtocolSupported.Add(34, "ANSI X3T9.5 FDDI");
            //a.dictionProtocolSupported.Add(35, "MCA");
            //a.dictionProtocolSupported.Add(36, "ESDI");
            //a.dictionProtocolSupported.Add(37, "IDE");
            //a.dictionProtocolSupported.Add(38, "CMD");
            //a.dictionProtocolSupported.Add(39, "ST506");
            //a.dictionProtocolSupported.Add(40, "DSSI");
            //a.dictionProtocolSupported.Add(41, "QIC2");
            //a.dictionProtocolSupported.Add(42, "Enhanced ATA/IDE");
            //a.dictionProtocolSupported.Add(43, "AGP");
            //a.dictionProtocolSupported.Add(44, "TWIRP (two-way infrared)");
            //a.dictionProtocolSupported.Add(45, "FIR (fast infrared)");
            //a.dictionProtocolSupported.Add(46, "SIR (serial infrared)");
            //a.dictionProtocolSupported.Add(47, "IrBus");


            Emit(sw, a);
            sw.WriteLine();
            sw.Close();
        }
コード例 #3
0
        protected override void FillFloppyDriveInfo()
        {
            ManagementObjectCollection moc = this.GetAllInfo(this.WSql);

            foreach (ManagementObject mo in moc)
            {
                Win32VideoController csp = new Win32VideoController();

                if (mo != null)
                {
                    csp.AcceleratorCapabilities = GetManagementObject <ushort[]>(mo, "AcceleratorCapabilities");
                    csp.AdapterCompatibility    = GetManagementObject <string>(mo, "AdapterCompatibility");
                    csp.AdapterDACType          = GetManagementObject <string>(mo, "AdapterDACType");
                    csp.AdapterRAM             = GetManagementObject <uint>(mo, "AdapterRAM");
                    csp.Availability           = GetManagementObject <ushort>(mo, "Availability");
                    csp.CapabilityDescriptions = GetManagementObject <string[]>(mo, "CapabilityDescriptions");
                    csp.Caption                     = GetManagementObject <string>(mo, "Caption");
                    csp.ColorTableEntries           = GetManagementObject <uint>(mo, "ColorTableEntries");
                    csp.ConfigManagerErrorCode      = GetManagementObject <uint>(mo, "ConfigManagerErrorCode");
                    csp.ConfigManagerUserConfig     = GetManagementObject <bool>(mo, "ConfigManagerUserConfig");
                    csp.CreationClassName           = GetManagementObject <string>(mo, "CreationClassName");
                    csp.CurrentBitsPerPixel         = GetManagementObject <uint>(mo, "CurrentBitsPerPixel");
                    csp.CurrentHorizontalResolution = GetManagementObject <uint>(mo, "CurrentHorizontalResolution");
                    csp.CurrentNumberOfColors       = GetManagementObject <ulong>(mo, "CurrentNumberOfColors");
                    csp.CurrentNumberOfColumns      = GetManagementObject <uint>(mo, "CurrentNumberOfColumns");
                    csp.CurrentNumberOfRows         = GetManagementObject <uint>(mo, "CurrentNumberOfRows");
                    csp.CurrentRefreshRate          = GetManagementObject <uint>(mo, "CurrentRefreshRate");
                    csp.CurrentScanMode             = GetManagementObject <ushort>(mo, "CurrentScanMode");
                    csp.CurrentVerticalResolution   = GetManagementObject <uint>(mo, "CurrentVerticalResolution");
                    csp.Description                 = GetManagementObject <string>(mo, "Description");
                    csp.DeviceID                    = GetManagementObject <string>(mo, "DeviceID");
                    csp.DeviceSpecificPens          = GetManagementObject <uint>(mo, "DeviceSpecificPens");
                    csp.DitherType                  = GetManagementObject <uint>(mo, "DitherType");
                    csp.Cim_DriverDate              = GetManagementObject <string>(mo, "DriverDate");
                    csp.DriverVersion               = GetManagementObject <string>(mo, "DriverVersion");
                    csp.ErrorCleared                = GetManagementObject <bool>(mo, "ErrorCleared");
                    csp.ErrorDescription            = GetManagementObject <string>(mo, "ErrorDescription");
                    csp.ICMIntent                   = GetManagementObject <uint>(mo, "ICMIntent");
                    csp.ICMMethod                   = GetManagementObject <uint>(mo, "ICMMethod");
                    csp.InfFilename                 = GetManagementObject <string>(mo, "InfFilename");
                    csp.InfSection                  = GetManagementObject <string>(mo, "InfSection");
                    csp.Cim_InstallDate             = GetManagementObject <string>(mo, "InstallDate");
                    csp.InstalledDisplayDrivers     = GetManagementObject <string>(mo, "InstalledDisplayDrivers");
                    csp.LastErrorCode               = GetManagementObject <uint>(mo, "LastErrorCode");
                    csp.MaxMemorySupported          = GetManagementObject <uint>(mo, "MaxMemorySupported");
                    csp.MaxNumberControlled         = GetManagementObject <uint>(mo, "MaxNumberControlled");
                    csp.MaxRefreshRate              = GetManagementObject <uint>(mo, "MaxRefreshRate");
                    csp.MinRefreshRate              = GetManagementObject <uint>(mo, "MinRefreshRate");
                    csp.Monochrome                  = GetManagementObject <bool>(mo, "Monochrome");
                    csp.Name = GetManagementObject <string>(mo, "Name");
                    csp.NumberOfColorPlanes          = GetManagementObject <ushort>(mo, "NumberOfColorPlanes");
                    csp.NumberOfVideoPages           = GetManagementObject <uint>(mo, "NumberOfVideoPages");
                    csp.PNPDeviceID                  = GetManagementObject <string>(mo, "PNPDeviceID");
                    csp.PowerManagementCapabilities  = GetManagementObject <ushort[]>(mo, "PowerManagementCapabilities");
                    csp.PowerManagementSupported     = GetManagementObject <bool>(mo, "PowerManagementSupported");
                    csp.ProtocolSupported            = GetManagementObject <ushort>(mo, "ProtocolSupported");
                    csp.ReservedSystemPaletteEntries = GetManagementObject <uint>(mo, "ReservedSystemPaletteEntries");
                    csp.SpecificationVersion         = GetManagementObject <uint>(mo, "SpecificationVersion");
                    csp.Status     = GetManagementObject <string>(mo, "Status");
                    csp.StatusInfo = GetManagementObject <ushort>(mo, "StatusInfo");
                    csp.SystemCreationClassName = GetManagementObject <string>(mo, "SystemCreationClassName");
                    csp.SystemName           = GetManagementObject <string>(mo, "SystemName");
                    csp.SystemPaletteEntries = GetManagementObject <uint>(mo, "SystemPaletteEntries");
                    csp.Cim_TimeOfLastReset  = GetManagementObject <string>(mo, "TimeOfLastReset");
                    csp.VideoArchitecture    = GetManagementObject <ushort>(mo, "VideoArchitecture");
                    csp.VideoMemoryType      = GetManagementObject <ushort>(mo, "VideoMemoryType");
                    csp.VideoMode            = GetManagementObject <ushort>(mo, "VideoMode");
                    csp.VideoModeDescription = GetManagementObject <string>(mo, "VideoModeDescription");
                    csp.VideoProcessor       = GetManagementObject <string>(mo, "VideoProcessor");

                    ps.Add(csp);
                }
            }
            moc.Dispose();
        }