Console auto closes instantly when i run the program
I made a geolocater, and once i type in the IP, it breifly shows all the info but then the console IMMEDIATEly closes and the program ends. how do i fig this?
4 Replies
Pls help
Add
Console.ReadLine()
at the end
It will only close after you press enter
Or Console.ReadKey()
and it will close after you press any button
Or change the setting in VS. Can't remember which one it is, but there is one that prevents the console from closingAdding: if you want to make an exitless program you can also use
while (true) {}
That is not usually recommended but will hang your program until an external close action.Thank you