Click here to Skip to main content
15,887,361 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Generalmicrosoft visio Pin
lalitmohankohli24-Feb-05 0:17
lalitmohankohli24-Feb-05 0:17 
GeneralMemory oddness Pin
Ray Cassick23-Feb-05 16:58
Ray Cassick23-Feb-05 16:58 
GeneralRe: Memory oddness Pin
Mike Dimmick24-Feb-05 5:12
Mike Dimmick24-Feb-05 5:12 
GeneralRe: Memory oddness Pin
Ray Cassick24-Feb-05 6:29
Ray Cassick24-Feb-05 6:29 
GeneralRe: Memory oddness Pin
Turok_4_2_024-Feb-05 14:22
Turok_4_2_024-Feb-05 14:22 
GeneralRe: Memory oddness Pin
Andy Brummer24-Feb-05 8:09
sitebuilderAndy Brummer24-Feb-05 8:09 
GeneralChange path of "obj" directory in .NET Pin
Mohammed Saleem23-Feb-05 0:02
Mohammed Saleem23-Feb-05 0:02 
GeneralProblems with process spawning Pin
usman.ghani22-Feb-05 8:11
usman.ghani22-Feb-05 8:11 
was trying to do this.

1. Spawn cmd.exe and have a dialog with it sending commands to it and getting the output.
I did all the relevant things . All those properties and things , But I cant read the output , or I think the process exits itself. The code I am trying is given below.

2. I was trying to spawn bitsadmin.exe with the argument /list but got this error .


BITSADMIN version 2.0 [ 6.6.2600.2180 ]
BITS administration utility.
(C) Copyright 2000-2004 Microsoft Corp.

Unable to get console input mode - 0x80070006
The handle is invalid.

// This is the the code I am using to try it out.

private void button1_Click(object sender, EventArgs e)
{

Process p = new Process();
ProcessStartInfo pInfo = new ProcessStartInfo();

pInfo.RedirectStandardOutput = true;
pInfo.RedirectStandardError = true;
pInfo.RedirectStandardInput = true;
pInfo.FileName = "bitsadmin.exe";
pInfo.Arguments = "/list";
pInfo.CreateNoWindow = true;
pInfo.UseShellExecute = false;

p.StartInfo = pInfo;
p.EnableRaisingEvents = true;
p.OutputDataReceived += new DataReceivedEventHandler(process1_OutputDataReceived);
p.ErrorDataReceived += new DataReceivedEventHandler(process1_ErrorDataReceived);
p.Exited += new EventHandler(process1_Exited);
p.Start ();
//p.StandardInput.WriteLine("dir");


}

private void process1_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
this.Text = "process1_OutputDataReceived";
textBox1.Text += e.Data + "\n";

}

private void process1_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
this.Text = "process1_ErrorDataReceived";
textBox1.Text += e.Data + "\n";
}

private void process1_Exited(object sender, EventArgs e)
{
this.Text = "process1_Exited";
Process p = sender as Process;
textBox1.Text += p.StandardOutput.ReadToEnd() + "\n";
}
}

GeneralRe: Problems with process spawning Pin
S. Senthil Kumar22-Feb-05 18:09
S. Senthil Kumar22-Feb-05 18:09 
GeneralRe: Problems with process spawning Pin
usman.ghani26-Feb-05 3:15
usman.ghani26-Feb-05 3:15 
Generalcreate copy of a hashtable... Pin
Ray Cassick21-Feb-05 19:09
Ray Cassick21-Feb-05 19:09 
GeneralRe: create copy of a hashtable... Pin
S. Senthil Kumar22-Feb-05 18:07
S. Senthil Kumar22-Feb-05 18:07 
GeneralLoading Assembly from a Web Service Pin
Vadim Tabakman21-Feb-05 18:29
Vadim Tabakman21-Feb-05 18:29 
Generalwindows application write to console Pin
krealiza21-Feb-05 16:42
krealiza21-Feb-05 16:42 
GeneralRe: windows application write to console Pin
Rei Miyasaka22-Feb-05 17:35
Rei Miyasaka22-Feb-05 17:35 
GeneralRe: windows application write to console Pin
krealiza22-Feb-05 17:57
krealiza22-Feb-05 17:57 
GeneralRe: windows application write to console Pin
Rei Miyasaka22-Feb-05 18:00
Rei Miyasaka22-Feb-05 18:00 
GeneralRe: windows application write to console Pin
krealiza22-Feb-05 18:13
krealiza22-Feb-05 18:13 
GeneralRe: windows application write to console Pin
Rei Miyasaka22-Feb-05 18:40
Rei Miyasaka22-Feb-05 18:40 
GeneralWebService Ticks must be between Pin
Vadim Tabakman21-Feb-05 14:54
Vadim Tabakman21-Feb-05 14:54 
GeneralCan't see anything (DirectX) Pin
truonghongquan21-Feb-05 14:41
truonghongquan21-Feb-05 14:41 
GeneralRe: Can't see anything (DirectX) Pin
truonghongquan1-Mar-05 15:04
truonghongquan1-Mar-05 15:04 
GeneralInstaller Files (prevent overwrite) Pin
swcrissman21-Feb-05 10:52
swcrissman21-Feb-05 10:52 
GeneralRe: Installer Files (prevent overwrite) Pin
rwestgraham23-Feb-05 13:32
rwestgraham23-Feb-05 13:32 
GeneralRe: Installer Files (prevent overwrite) Pin
swcrissman25-Feb-05 10:57
swcrissman25-Feb-05 10:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.