1 Attachment(s)
Logging into a Windows Forms Application
Something like this may have been posted before but I created this demo to answer a question recently so I decided to post it here. This demo displays a login dialogue before creating the main window. If the user either cancels the login or else provides invalid credentials three times the app will exit without ever creating a main window at all. If the login is successful within three attempts then login dialogue is dismissed and the main window is displayed.
Make sure you check out the Program.cs file, which is where the Main method is located. It's there that the decisions are made.
Note that the attached solution was created in VS 2005. It should upgrade fine to VS 2008, although I haven't tested that.