Vladimir Ota

Vladimir Ota

  • NA
  • 10
  • 0

Exitin the program

Sep 26 2008 1:21 AM

I have a piece of code like the one below. It gets a string from somewhere, checks it and if string is empty it should display the message and exit the program. The problem is that it doesn't exit but continues. I can not figure out what I'm doing wrong.

public Form1()
{
    InitializeComponent();
   string str=getString();
   if (str=="")
   {
       MessageBox.Show("string is empty")
       Application.Exit();
    }
    .....
    .....
}


Answers (2)