Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

duhow's profile on WallpaperFusion.com

Code

// Set at beginning:
using System.Diagnostics;
using System.Collections.Generic;

// --------------

Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.FileName = "wmic";
p.StartInfo.Arguments = "cpu get loadpercentage";

string salida = "";
string[] separator = new string[] {"\n"};
string[] output;

p.Start();
salida = p.StandardOutput.ReadToEnd();
p.WaitForExit();

output = salida.Split(separator, StringSplitOptions.None);
string carga = output[1].Trim(); // LoadPercentage -> numero

BFS.Speech.TextToSpeech(carga + " percent");
Feb 26, 2017 (modified Mar 8, 2017)  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Thanks for sending this over! We'll add it to the repository :)
Feb 28, 2017  • #2
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(1)  Login to Vote(-)