Hi,
I use ConsoleWriteline in my console appl but it shows up only very short in a less than a second and disappears
Can anybody help me what to do please?
Thanks
p.s
example
if (i == 15 && r == 16)
{
double Cr = 2048 / counterTotal1;
double Nb = counterTotal1 / 256;
Console.WriteLine("Cr"+Cr.ToString());
Console.WriteLine("Nb" + Nb.ToString());
}
VulpesPosted Nov 23, 2014, 11:06 AM
Try putting it as the very last line in the Main() method.
NelPosted Nov 23, 2014, 5:23 PM
NelPosted Nov 23, 2014, 10:58 AM
Hi
thank to both of you but even when I put Console.ReadKey(true) as in example, again the same thing happens The window disappears again
StavriPosted Nov 23, 2014, 9:13 AM
In order to read the console's output,
you can write the expression "Console.ReadKey();"
just like it is shown in the example below.
I hope that the provided solution helps :)
Best regards,
Stavri
//-------------------------------------------------------
using System;
namespace ConsoleApplication_HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
Console.ReadKey();
}
}
}
//-------------------------------------------------------
VulpesPosted Nov 23, 2014, 8:58 AM
This will prevent the console window from closing until you've read the output and a key has been pressed.