Home All Groups Group Topic Archive Search About
Author
12 Dec 2008 12:03 AM
DaveL
I have a console application...i run the code i need to run
its all good....but when its back to the main
it has a wait press any key

how to make console applications just exit

thanks
DaveL

Author
12 Dec 2008 12:25 AM
Family Tree Mike
"DaveL" <dvs_***@sbcglobal.net> wrote in message
news:QRh0l.11225$ZP4.9604@nlpi067.nbdc.sbc.com...
>I have a console application...i run the code i need to run
> its all good....but when its back to the main
> it has a wait press any key
>
> how to make console applications just exit
>
> thanks
> DaveL
>
>


Well, it depends on what your code says...

I would guess you have something like:

Console.Out.WriteLine("Presss any key...");
Console.In.ReadLine();

Take those lines out...

--
Mike
Are all your drivers up to date? click for free checkup

Author
12 Dec 2008 12:27 AM
Peter Duniho
On Thu, 11 Dec 2008 16:03:53 -0800, DaveL <dvs_***@sbcglobal.net> wrote:

> I have a console application...i run the code i need to run
> its all good....but when its back to the main
> it has a wait press any key
>
> how to make console applications just exit

Remove the line of code that waits for the user to press a key.
Author
12 Dec 2008 12:34 AM
DaveL
None There

here is a piece of code
class Program
    {
        static void Main(string[] args)
        {
            BatchJob oBatch = new BatchJob();
            try
            {



                oBatch.LoadClassConfig();
                oBatch.IsUserInterface = true;
                oBatch.RunJob();
            }
            catch (Exception ex)
            {
                if (oBatch.IsUserInterface == true)
                {
                    NetTools.dvErrorSysWin.ShowError(ex);
                }
            }
            Console.WriteLine("here");
            //still shows press any key at this point
            return;

        }
    }

Show quoteHide quote
"Peter Duniho" <NpOeStPe***@nnowslpianmk.com> wrote in message
news:op.ul0wvfib8jd0ej@petes-computer.local...
> On Thu, 11 Dec 2008 16:03:53 -0800, DaveL <dvs_***@sbcglobal.net> wrote:
>
>> I have a console application...i run the code i need to run
>> its all good....but when its back to the main
>> it has a wait press any key
>>
>> how to make console applications just exit
>
> Remove the line of code that waits for the user to press a key.
Author
12 Dec 2008 12:45 AM
DaveL
I found the problem....i did nto realize
while in vs running it the host process does the press any key

sorry

DaveL

Show quoteHide quote
"Peter Duniho" <NpOeStPe***@nnowslpianmk.com> wrote in message
news:op.ul0wvfib8jd0ej@petes-computer.local...
> On Thu, 11 Dec 2008 16:03:53 -0800, DaveL <dvs_***@sbcglobal.net> wrote:
>
>> I have a console application...i run the code i need to run
>> its all good....but when its back to the main
>> it has a wait press any key
>>
>> how to make console applications just exit
>
> Remove the line of code that waits for the user to press a key.

Bookmark and Share