예제 #1
0
        /// <summary>
        /// This functions queries the different software / hardware records in order to get their properties
        /// </summary>
        /// <returns>0 if success and -1 if an exception arises</returns>
        public int Run()
        {
            try
            {
                int error = 0;

                // Gather generic system information
                PlatformInformation.GetSystemInfo();

                // Get specific CPU information
                GetCPUInfo();

                // Get memory information
                GetMemoryInfo();

                // Compute memory parameters
                MemoryInformation.GetMemoryInfo(System_Memory);
#if DEBUG
                Console.WriteLine(MemoryInformation.ToString());
#endif

                if (Globals.Enable_File_Output)
                {
                    Tools.SaveData(Globals.Output_Filename, $"{MemoryInformation.ToString()}\n", true);
                }

                // Get video controller information
                GetVideoControllerInfo();

                // Get disk information
                GetDiskDriveInfo();

                // Get disk partitions
                GetDiskPartitionInfo();

                return(error);
            }
            catch (Exception ex)
            {
#if DEBUG
                Console.WriteLine($"Exception Message: {ex.Message}");
#endif
                return(-1);
            }
        }