jorge Posted February 14, 2004 Posted February 14, 2004 Hello, I it posible to get the output of a console application? if yes any pointer on how to do it? Quote Jorge - http://www.blackdot.be/?page=apache.htm
Moderators Robby Posted February 14, 2004 Moderators Posted February 14, 2004 Into another application? Quote Visit...Bassic Software
jorge Posted February 14, 2004 Author Posted February 14, 2004 yes, sry thah i didn't explean mysellf clearly(sry happen a lot :( ) I have a application and i call: pacth to exe/apache.exe -t, it open a command windows with the text syntax ok, or a error msg if somthing is wrong, instead of showing the command windows i would like to put the information into a textbox. Quote Jorge - http://www.blackdot.be/?page=apache.htm
*Experts* mutant Posted February 14, 2004 *Experts* Posted February 14, 2004 The ProcessStartInfo class will provide you with an option to get the output from a console app. Then you can pass in the ProcessStartInfo class into the Process.Start method. Dim pi As New ProcessStartInfo("cmd.exe") pi.RedirectStandardOutput = True pi.UseShellExecute = False 'required call to redirect streams Dim p As Process = p.Start(pi) p.WaitForExit() MessageBox.Show(p.StandardOutput.ReadToEnd()) 'show what the application tried to print onto the console Now this will get all the text that the application would normally print ou to the console and put into the stream instead, thus nothing will print on the console itself. Quote
jorge Posted February 14, 2004 Author Posted February 14, 2004 ok i pass /k apache -t to cmd.exe, but it only returns: Microsoft Windows XP [Version 5.1.2600] © Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Jorge Schrauwen\Desktop\pluginexample\WindowsApplication1\bin> C:\Documents and Settings\Jorge Schrauwen\Desktop\pluginexample\WindowsApplication1\bin> instead of systax ok, and nothing when i start apache.exe instread of cmd and pass the argument "-t" Quote Jorge - http://www.blackdot.be/?page=apache.htm
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.