我在网上找到了这段代码
Imports System
Imports System.Collections.Specialized
Namespace Williablog.Net.Examples.Providers
Public Class SqlMembershipProvider
Inherits System.Web.Security.SqlMembershipProvider
Public Overrides Sub Initialize(ByVal name As String, ByVal config As System.Collections.Specialized.NameValueCollection)
' intercept the setting of the connection string so that we can set it ourselves...
Dim specifiedConnectionString As String = config.Item("connectionStringName")
config.Item("connectionStringName") = GetYourRunTimeConnectionStringNAme(specifiedConnectionString)
' Pass doctored config to base classes
MyBase.Initialize(name, config)
End Sub
End Class
End Namespace
我认为它会解决我的问题。