Friday, April 29, 2011

Winforms login application samples?

Hey Everyone,

I will be working on a Time Management application very soon using Winforms and Access and was looking for some good resources on how to create a simple password protected application. I came from asp.net but have VERY little experience with Winforms. Are there and end to end tutorials for something like this?

Thanks everyone.

From stackoverflow
  • Well. in VB.net you have a template for a login form. Just Add/New Item, select "Login Form". But that just creates a dialog with two textboxes, username and password. Everyone can do that.

    Then its up to you how to verify that the entered username and password are a valid user, against a database, encrypted textfile, encrypted strings in the registry or a xml-file or whatever you want.

    In the generated form there are also some information:

    ' TODO: Insert code to perform custom authentication using the
    

    provided username and password ' (See http://go.microsoft.com/fwlink/?LinkId=35339).

    ' The custom principal can then be attached to the current thread's
    

    principal as follows: ' My.User.CurrentPrincipal = CustomPrincipal ' where CustomPrincipal is the IPrincipal implementation used to perform authentication. ' Subsequently, My.User will return identity information encapsulated in the CustomPrincipal object ' such as the username, display name, etc.

    If you follow that link youll end up here: http://msdn.microsoft.com/en-us/library/aa302401.aspx

    Wich is not maybe the best place to be in you think, as it is focused on ASP.Net But check out the related chapters there as it tells you a lot about encryption and other usefull things in this area.

    If you just have an application that is running in single user mode, then its enough to store users and passwords encrypted in the registry or an local xml-file or anything like that.

0 comments:

Post a Comment