// 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 = "fsutil"; p.StartInfo.Arguments = "volume diskfree c:"; string salida = ""; string[] separator = new string[] {"\n"}; string[] output; p.Start(); salida = p.StandardOutput.ReadToEnd(); p.WaitForExit(); output = salida.Split(separator, StringSplitOptions.None); string total = output[1].Substring(41); total = total.Substring(1, total.Length - 1); string libre = output[2].Substring(41); libre = libre.Substring(1, libre.Length - 1); long ttot = Int64.Parse(total); long tlib = Int64.Parse(libre); long tfin = tlib / 1024 / 1024; long tmeg = tfin % 1024; tfin = tfin / 1024; BFS.Speech.TextToSpeech(tfin.ToString() + " gigas y " + tmeg.ToString() + " megas");