Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Winforms login application samples?

Tags:

winforms

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.

like image 261
Todd Avatar asked May 16 '26 20:05

Todd


1 Answers

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.

like image 176
Stefan Avatar answered May 19 '26 17:05

Stefan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!