hi everyone, how to close an application when the user fails to enter thro login after his 3rd attempt......
i.e my application should allow any user to login for maximum of 3 times if he is unable to enter the correct userid & pwd,then my application should close ......
Close application
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Vimal KandasamyRank #2,151 · 661 reputationPosted Apr 23, 2009, 3:44 AM EDT
Simply create a counter value..like
int ErrCount=0;
whenever login failed you increase it
and check whether it reach 3
if it reaches 3 then use
Application.Exit();
to terminate application.
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Apr 23, 2009, 3:43 AM EDT
You can use the following code to close the application.
System.Windows.Forms.Application.Exit();
mohan12 reputationPosted Apr 23, 2009, 4:33 AM EDT
could u give a try for my another post which is about datagridview......
hope u have already seen it.....
any how i am asking u once again......ie especially in winforms application........