Exemple #1
0
        public static void Main(string[] args)
        {
            Detector d = new Detector();

            Console.WriteLine("Detected CPUs:");
            foreach(ProcessorDTOResponse item in d.GetProcessorsInfo())
            {
                PropertiesPrinter.Print(item);
            }

            Console.WriteLine("\nDetected memory:");
            foreach(MemoryDTOResponse item in d.GetMemoryInfo())
            {
                PropertiesPrinter.Print(item);
            }

            Console.WriteLine("\nDetected OS:");
            OperatingSystemDTOResponse os = d.GetOperatingSystemInfo();
            PropertiesPrinter.Print(os);

            Console.WriteLine("\nDetected storage:");
            foreach(StorageDTOResponse item in d.GetStorageInfo())
            {
                PropertiesPrinter.Print(item);
            }

            Console.WriteLine("\nDetected ethernets:");
            foreach(EthernetDTOResponse item in d.GetEthernetInfo())
            {
                PropertiesPrinter.Print(item);
            }

            Console.WriteLine("\nDetected fc cards:");
            foreach(FibreChannelDTOResponse item in d.GetFibreChannelInfo())
            {
                PropertiesPrinter.Print(item);
            }

            Console.WriteLine("\nDetected shares:");
            foreach(DiskShareMountDTOResponse item in d.GetDiskShareMountInfo())
            {
                PropertiesPrinter.Print(item);
            }

            Console.WriteLine("\nDetected software:");
            foreach(SoftwareDTOResponse item in d.GetSoftwareInfo())
            {
                PropertiesPrinter.Print(item);
            }

            Console.WriteLine("\nDetected device:");
            DeviceDTOResponse dev = d.GetDeviceInfo();
            PropertiesPrinter.Print(dev);

            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            Detector d = new Detector();

            Console.WriteLine("Detected CPUs:");
            foreach(ProcessorDTOResponse item in d.GetProcessorsInfo())
            {
                foreach(var prop in item.GetType().GetProperties()) {
                    Console.WriteLine("\t{0}: {1}", prop.Name, prop.GetValue(item, null));
                }
                Console.WriteLine();
            }

            Console.WriteLine("\nDetected memory:");
            foreach(MemoryDTOResponse item in d.GetMemoryInfo())
            {
                foreach(var prop in item.GetType().GetProperties()) {
                    Console.WriteLine("\t{0}: {1}", prop.Name, prop.GetValue(item, null));
                }
                Console.WriteLine();
            }

            Console.WriteLine("\nDetected OS:");
            OperatingSystemDTOResponse os = d.GetOperatingSystemInfo();
            foreach(var prop in os.GetType().GetProperties()) {
                Console.WriteLine("\t{0}: {1}", prop.Name, prop.GetValue(os, null));
            }
            Console.WriteLine();

            Console.WriteLine("\nDetected storage:");
            foreach(StorageDTOResponse item in d.GetStorageInfo())
            {
                foreach(var prop in item.GetType().GetProperties()) {
                    Console.WriteLine("\t{0}: {1}", prop.Name, prop.GetValue(item, null));
                }
                Console.WriteLine();
            }

            Console.WriteLine("\nDetected ethernets:");
            foreach(EthernetDTOResponse item in d.GetEthernetInfo())
            {
                foreach(var prop in item.GetType().GetProperties()) {
                    Console.WriteLine("\t{0}: {1}", prop.Name, prop.GetValue(item, null));
                }
                Console.WriteLine();
            }

            Console.WriteLine("\nDetected fc cards:");
            foreach(FibreChannelDTOResponse item in d.GetFibreChannelInfo())
            {
                foreach(var prop in item.GetType().GetProperties()) {
                    Console.WriteLine("\t{0}: {1}", prop.Name, prop.GetValue(item, null));
                }
                Console.WriteLine();
            }

            Console.WriteLine("\nDetected shares:");
            foreach(DiskShareMountDTOResponse item in d.GetDiskShareMountInfo())
            {
                foreach(var prop in item.GetType().GetProperties()) {
                    Console.WriteLine("\t{0}: {1}", prop.Name, prop.GetValue(item, null));
                }
                Console.WriteLine();
            }

            Console.WriteLine("\nDetected device:");
            DeviceDTOResponse dev = d.GetDeviceInfo();
            foreach(var prop in dev.GetType().GetProperties()) {
                Console.WriteLine("\t{0}: {1}", prop.Name, prop.GetValue(dev, null));
            }
            Console.WriteLine();

            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
Exemple #3
0
		public void Print(Detector d, bool jsonOnly)
		{
			if (jsonOnly)
			{
				Console.WriteLine(d.GetAllComponentsJSON());
			}
			else
			{
				Console.WriteLine("Detected CPUs:");
				foreach(ProcessorDTOResponse item in d.GetProcessorsInfo())
				{
					PropertiesPrinter.Print(item);
				}
				
				Console.WriteLine("\nDetected memory:");
				foreach(MemoryDTOResponse item in d.GetMemoryInfo())
				{
					PropertiesPrinter.Print(item);
				}
				
				Console.WriteLine("\nDetected OS:");
				OperatingSystemDTOResponse os = d.GetOperatingSystemInfo();
				PropertiesPrinter.Print(os);
				
				Console.WriteLine("\nDetected storage:");
				foreach(StorageDTOResponse item in d.GetStorageInfo())
				{
					PropertiesPrinter.Print(item);
				}
				
				Console.WriteLine("\nDetected IP addresses:");
				foreach(IPAddressDTOResponse item in d.GetIPAddressInfo())
				{
					PropertiesPrinter.Print(item);
				}
				
				Console.WriteLine("\nDetected MAC addresses:");
				foreach(MacAddressDTOResponse item in d.GetMacAddressInfo())
				{
					PropertiesPrinter.Print(item);
				}
				
				Console.WriteLine("\nDetected fc cards:");
				foreach(FibreChannelDTOResponse item in d.GetFibreChannelInfo())
				{
					PropertiesPrinter.Print(item);
				}
				
				Console.WriteLine("\nDetected shares:");
				foreach(DiskShareMountDTOResponse item in d.GetDiskShareMountInfo())
				{
					PropertiesPrinter.Print(item);
				}
				
				Console.WriteLine("\nDetected software:");
				foreach(SoftwareDTOResponse item in d.GetSoftwareInfo())
				{
					PropertiesPrinter.Print(item);
				}
				
				Console.WriteLine("\nDetected device:");
				DeviceDTOResponse dev = d.GetDeviceInfo();
				PropertiesPrinter.Print(dev);
			}
		}