473,287 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Custom membership provider - help needed

I need to implement a login system using Asp.net 2.0 login
module( membership provider) with password being case insensitive. I
wrote a class Accessmembershipprovider.vb and below is my code.
Somehow, it does seem that the validate users logic is picking this
new code up. Can anyone tell me what I might have missed out?

Regards
================================================== >
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Web.Configuration
Imports System.Data.SqlClient

Public Class AccessMembershipProvider
Inherits MembershipProvider

Public Overrides Sub Initialize(ByVal name As String, ByVal config
As System.Collections.Specialized.NameValueCollection )

End Sub

Public Overrides Property ApplicationName() As String
Get
End Get
Set(ByVal value As String)
End Set
End Property

Public Overrides Function ChangePassword(ByVal username As String,
ByVal oldPassword As String, ByVal newPassword As String) As Boolean

End Function

Public Overrides Function ChangePasswordQuestionAndAnswer(ByVal
username As String, ByVal password As String, ByVal
newPasswordQuestion As String, ByVal newPasswordAnswer As String) As
Boolean

End Function

Public Overrides Function CreateUser(ByVal username As String,
ByVal password As String, ByVal email As String, ByVal
passwordQuestion As String, ByVal passwordAnswer As String, ByVal
isApproved As Boolean, ByVal providerUserKey As Object, ByRef status
As System.Web.Security.MembershipCreateStatus) As
System.Web.Security.MembershipUser

End Function

Public Overrides Function DeleteUser(ByVal username As String,
ByVal deleteAllRelatedData As Boolean) As Boolean

End Function

Public Overrides ReadOnly Property EnablePasswordReset() As
Boolean
Get

End Get
End Property

Public Overrides ReadOnly Property EnablePasswordRetrieval() As
Boolean
Get

End Get
End Property

Public Overrides Function FindUsersByEmail(ByVal emailToMatch As
String, ByVal pageIndex As Integer, ByVal pageSize As Integer, ByRef
totalRecords As Integer) As
System.Web.Security.MembershipUserCollection

End Function

Public Overrides Function FindUsersByName(ByVal usernameToMatch As
String, ByVal pageIndex As Integer, ByVal pageSize As Integer, ByRef
totalRecords As Integer) As
System.Web.Security.MembershipUserCollection

End Function

Public Overrides Function GetAllUsers(ByVal pageIndex As Integer,
ByVal pageSize As Integer, ByRef totalRecords As Integer) As
System.Web.Security.MembershipUserCollection

End Function

Public Overrides Function GetNumberOfUsersOnline() As Integer

End Function

Public Overrides Function GetPassword(ByVal username As String,
ByVal answer As String) As String

End Function

Public Overloads Overrides Function GetUser(ByVal username As
String, ByVal userIsOnline As Boolean) As
System.Web.Security.MembershipUser

End Function

Public Overloads Overrides Function GetUser(ByVal providerUserKey
As Object, ByVal userIsOnline As Boolean) As
System.Web.Security.MembershipUser

End Function

Public Overrides Function GetUserNameByEmail(ByVal email As
String) As String

End Function

Public Overrides ReadOnly Property MaxInvalidPasswordAttempts() As
Integer
Get

End Get
End Property

Public Overrides ReadOnly Property
MinRequiredNonAlphanumericCharacters() As Integer
Get

End Get
End Property

Public Overrides ReadOnly Property MinRequiredPasswordLength() As
Integer
Get

End Get
End Property

Public Overrides ReadOnly Property PasswordAttemptWindow() As
Integer
Get

End Get
End Property

Public Overrides ReadOnly Property PasswordFormat() As
System.Web.Security.MembershipPasswordFormat
Get

End Get
End Property

Public Overrides ReadOnly Property
PasswordStrengthRegularExpression() As String
Get

End Get
End Property

Public Overrides ReadOnly Property RequiresQuestionAndAnswer() As
Boolean
Get

End Get
End Property

Public Overrides ReadOnly Property RequiresUniqueEmail() As
Boolean
Get

End Get
End Property

Public Overrides Function ResetPassword(ByVal username As String,
ByVal answer As String) As String

End Function

Public Overrides Function UnlockUser(ByVal userName As String) As
Boolean

End Function

Public Overrides Sub UpdateUser(ByVal user As
System.Web.Security.MembershipUser)

End Sub

Public Overrides Function ValidateUser(ByVal username As String,
ByVal password As String) As Boolean
Dim strconnectionString As String =
WebConfigurationManager.ConnectionStrings("LocalSq lServer").ConnectionString
Dim con As New SqlConnection(strconnectionString)

Try
con.Open()
Dim sql As String = "Select * From Membership WHERE " & _
"username=@username AND password=@password"
Dim comm As New SqlCommand(sql, con)
password = password.ToUpper()
comm.Parameters.AddWithValue("@username", username)
comm.Parameters.AddWithValue("@password", password)
Dim reader As SqlDataReader = comm.ExecuteReader
If reader.HasRows Then
Return True
Else
Return False
End If
con.Close()

Catch ex As Exception
Console.Write(ex.ToString)
Return False
End Try
End Function
End Class

Apr 30 '07 #1
0 1545

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
2
by: WB | last post by:
Hi, I am revamping my company's website with ASP.Net 2.0. In order to use our existing user data in our SQL 2000, I have written a custom membership provider. However, when I try to logon with...
2
by: John | last post by:
Hi I was working fine with create user wizard and the default membership provider. I have now customised the membership provider as per attached web.config. The create user wizard picks up the...
4
by: techsupport | last post by:
I have some experience with .NET Remoting, as well as ASP.NET 2.0, and have been wanting to remote a custom membership and profile provider. I want to take advantage of the new controls in ASP.NET...
1
by: Axford | last post by:
Hello, I am trying to implement my own custom provider for memberships, basically only id/pwd (no roles). I use the new login web control (I am using asp.net 2.0 and VS2005). In web.config I...
1
by: kvr901 | last post by:
I've been trying to use this "custom membership provider" stuff for several days, and am totally lost. I am building an ASP.NET (vb) application on a laptop. Then I copy the files to a Win 2003...
0
by: Mwob | last post by:
Hi all, I'm about to start creating a custom membership provider. Its for a website that already has a table of users in a single table, so I need to create a custom MP to talk to the data in...
4
by: alexandis | last post by:
We have tables of logins (users), that differs much from standard microsoft structure - we don't use control question/answer, date fields, etc. But instead we have several additional fields. I...
3
by: Sunfire | last post by:
I need to use a custom database for all of the user membership and rolls. How do you do this?
6
by: Jonathan Wood | last post by:
Although this will be a challenge at my level of ASP.NET knowledge, I'm thinking I should implement my own membership provider class. Looking over the methods I must implement, a number of...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.