예제 #1
0
 static void Main(string[] args)
 {
     if (args.Length >= 0 && !string.IsNullOrEmpty(args[0]) && File.Exists(args[0]))
     {
         var programs   = new InstalledPrograms();
         var programKey = "RealPlay.exe".ToLowerInvariant();
         if (programs.ContainsKey(programKey))
         {
             var programPath = programs[programKey];
             if (!string.IsNullOrEmpty(programPath) && File.Exists(programPath))
             {
                 var process = new Process();
                 process.StartInfo           = new ProcessStartInfo(programPath);
                 process.StartInfo.Arguments = args[0];
                 if (process.Start())
                 {
                     Console.WriteLine("That was easy!");
                 }
                 else
                 {
                     Console.WriteLine("Hell's bells and buckets of blood, we seem to have hit a snag!");
                 }
             }
         }
     }
     else
     {
         Console.WriteLine("Specify a file as an argument, silly!");
     }
     Console.WriteLine();
     Console.WriteLine("Press any key to exit...");
     Console.ReadKey();
 }
예제 #2
0
        private InstalledModel SendInstalledPrograms()
        {
            InstalledModel im = new InstalledModel();

            im.token = token;
            im.InstalledProgramsViewModel = InstalledPrograms.GetInstalledPrograms();
            return(im);
        }
        public ComputerInfo GetComputerInfo()
        {
            string mainSeparator = new string('=', 80);

            StringBuilder text = new StringBuilder();

            try
            {
                Version currentVersion = getCV4WVersion();

                text.AppendLine($"CV4W {currentVersion.ToString(3)} diagnostics log");
                text.AppendLine(mainSeparator);
                text.AppendLine();
                text.AppendLine(getIpConfigInfo());
                text.AppendLine();
                text.AppendLine(mainSeparator);
                text.AppendLine();
                text.AppendLine(InstalledPrograms.BuildInstalledProgramsReport());
                text.AppendLine();
                text.AppendLine(mainSeparator);
                text.AppendLine();
                text.AppendLine(getRunningProcessesReport());
                text.AppendLine();
                text.AppendLine(mainSeparator);
                text.AppendLine("End of Diagnostics log");

                return(new ComputerInfo()
                {
                    DiagnosticsText = text.ToString()
                });
            }
            catch (Exception ex)
            {
                if (text != null)
                {
                    text.AppendLine(mainSeparator);
                    text.AppendLine(ex.ToString());

                    return(new ComputerInfo()
                    {
                        DiagnosticsText = text.ToString()
                    });
                }
                else
                {
                    return(new ComputerInfo()
                    {
                        DiagnosticsText = ex.ToString()
                    });
                }
            }
        }
예제 #4
0
 public Reporting()
 {
     os = new OperatingSystem();
     cpu = new CPU();
     gfx = new GFX();
     hardDrive = new HardDrive();
     programs = new InstalledPrograms();
     mb = new Motherboard();
     pageFile = new PageFile();
     processes = new ProcessList();
     memory = new RAM();
     services = new ServiceList();
     startupItems = new StartupItems();
     hd = new HardDrive();
     report = "";
 }
예제 #5
0
 public Reporting()
 {
     os           = new OperatingSystem();
     cpu          = new CPU();
     gfx          = new GFX();
     hardDrive    = new HardDrive();
     programs     = new InstalledPrograms();
     mb           = new Motherboard();
     pageFile     = new PageFile();
     processes    = new ProcessList();
     memory       = new RAM();
     services     = new ServiceList();
     startupItems = new StartupItems();
     hd           = new HardDrive();
     report       = "";
 }
예제 #6
0
 private void btn_Get_Click(object sender, RoutedEventArgs e)
 {
     InstalledPrograms.GetInstalledPrograms();
     MessageBox.Show("Finished");
 }