How to read standard output from a command run via Process.Start() as a list or array
<p>I need to get a list of all the scheduled tasks running on a certain host into a list or array in C#.</p>

<p>The query</p>

<pre><code>schtasks /query /S CHESTNUT105B /FO List
</code></pre>

<p>returns a list like this:</p>

<pre><code>HostName:      CHESTNUT105B
TaskName:      Calculator
Next Run Time: 12:00:00, 10/28/2010
Status:        Running

HostName:      CHESTNUT105B
TaskName:      GoogleUpdateTaskMachineCore
Next Run Time: At logon time
Status:

HostName:      CHESTNUT105B
TaskName:      GoogleUpdateTaskMachineCore
Next Run Time: 13:02:00, 10/28/2010
</code></pre>

<p>I have the following code to execute the command I specified above: </p>

<pre><code>static void Main(string[] args)
{
    Process p = new Process();
    p.StartInfo.UseShellExecute = false;
    p.StartInfo.FileName = "SCHTASKS.exe";
    p.StartInfo.RedirectStandardError = true;
    p.StartInfo.RedirectStandardOutput = true;
    p.StartInfo.CreateNoWindow = true;
    p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;


    string MachineName = "CHESTNUT105b";
    string ScheduledTaskName = "Calculator";
    string activeDirectoryDomainName = "xxx";
    string userName = "xxx";
    string password = "xxxxx";

    p.StartInfo.Arguments = String.Format("/Query /S {0} /FO LIST", MachineName);

    p.Start();
}
</code></pre>

<p>How can I read the list generated into a list in C#?</p>
