while (true)
{
}
That's an infinite loop
Edit:
Let me expand on that a bit....if this is a Winforms app and you execute this on the UI thread, you'll block your UI. Either execute on a background thread or make the loop exit at some point
You can force the loop to exit by using a
break;
statement if the loop meets some condition