Console application

  • Thread starter Thread starter jam
  • Start date Start date
J

jam

Hello all,

how can I stop the current process when I am write a console application??
Also, can i run command prompt command in the console application??
the programme I am writing is to get data from data base and then generate
some txt file, I wanna stop it when it reaches some error/special text

thanks,
Chris Choi
 
Hello Chris,
Also, can i run command prompt command in the console application??

Yes, by using the System.Diagnostics.Process class and setting
UseShellExecute to 'true' in the ProcessStartupInfo structure.
how can I stop the current process when I am write a console application??

Just exit from the Main method.
 
thx a lot, I will try on this,
Dmitriy Lapshin said:
Hello Chris,
Also, can i run command prompt command in the console application??

Yes, by using the System.Diagnostics.Process class and setting
UseShellExecute to 'true' in the ProcessStartupInfo structure.
how can I stop the current process when I am write a console
application??

Just exit from the Main method.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

jam said:
Hello all,

how can I stop the current process when I am write a console application??
Also, can i run command prompt command in the console application??
the programme I am writing is to get data from data base and then generate
some txt file, I wanna stop it when it reaches some error/special text

thanks,
Chris Choi
 
Back
Top