Saturday, March 24, 2012

Login Form

Anyone knows how to create a login form against SQL Server database with REMEMBER ME function by using vb.net?Hi
You may download this PDF
Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/secnetlpMSDN.asp
Regards
Find a tutorial on using Forms Authentication
i understand this question from different angle ....i think ywang asking about when some one register or login to any wesite like asp.net website as example .... the user when visit again he will be able to look at his page account without the logging everytime he visit the website !!!! if that what you are looking for ... i think the cookie will do the job and i did not tried it myself as i did not come cross this kind of requirement but i have tried that with cookie and it works fine unless there is another solution that anyone would like to recommend!!!
i hope i am not out of the subject as this is my understadning of the question !!! sorry if i was too far !!!
You may download the ASP.NET Resource Kit:
http://www.microsoft.com/downloads/details.aspx?FamilyID=aef6aa76-ab88-4264-87b4-8e946ef584d7&DisplayLang=en
Here is some code:
Private Sub btnLogon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogon.Click
Dim passwordVerified As Boolean = False
Try
passwordVerified = VerifyPassword(txtEmail.Text, txtPassword.Text)
Catch ex As Exception
lblMessage.Text = ex.Message
Return
End Try
If passwordVerified = True Then
' The user is authenticated
' At this point, an authentication ticket is normally created
' This can subsequently be used to generate a GenericPrincipal
' object for .NET authorization purposes
' For details, see "How To: Use Forms authentication with GenericPrincipal
' objects
FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, CheckBox1.Checked)
Else
lblMessage.Text = "Invalid username or password"
End If
End Sub
Best Regards

0 comments:

Post a Comment