batman
4
Q:

c# exit for

while (playerIsAlive) 
{ 
// this code will keep running
  if (playerIsAlive == false) 
  { 
    // eventually if this stopping condition is true, 
    // it will break out of the while loop
    break; 
   } 
 } 

// rest of the program will continue
3
// In a console application:
Environment.Exit(0);
// In a WPF application:
Close();
1
Use "break;"
  
for (int i = 1; i <= 100; i++)
{
	if (i == 5)
	{
		break;
	}
}
1
System.Windows.Forms.Application.ExitThread( )
-1

New to Communities?

Join the community