===========================================================================
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
//using System.IO.StreamReader;
//using System.IO;
namespace Reading
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnOK_Click(object sender, EventArgs e)
{
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "TestApp.exe";
p.StartInfo.Arguments = "";
p.StartInfo.[color="#FF0000"]RedirectStandardOutput [/color]= true;
p.StartInfo.[color="#FF0000"]RedirectStandardInput [/color]= true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.[color="#FF0000"]CreateNoWindow [/color]= true;
p.[color="#FF0000"]OutputDataReceived [/color]+= new System.Diagnostics.[color="#FF0000"]DataReceivedEventHandler[/color](ConsoleOutputHandler);
p.Start();
p.[color="#FF0000"]BeginOutputReadLine[/color]();
}
}
}
This post has been edited by JackOfAllTrades: 30 June 2010 - 06:57 PM
Reason for edit:: Added code tags.

New Topic/Question
Reply
MultiQuote








|