By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,312 Members | 1,265 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,312 IT Pros & Developers. It's quick & easy.

Console application

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <hk***@hotmail.com> wrote in message
news:Ot**************@TK2MSFTNGP15.phx.gbl... 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


Nov 16 '05 #2

P: n/a
jam
thx a lot, I will try on this,
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> bl
news:eH**************@TK2MSFTNGP12.phx.gbl g...
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" <hk***@hotmail.com> wrote in message
news:Ot**************@TK2MSFTNGP15.phx.gbl...
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

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.