English 中文(简体)
• 将网络成员改为数据库 这是否可行?
原标题:Moving asp.net membership web.config settings to Database Is this even possible?

I am hoping for fruitful answer to this. How should i move the settings provided in web.config for asp.net membership into a database for cross application customization. For example membership information include below

  <providers>
    <add 
      name="OdbcProvider" 
      type="Samples.AspNet.Membership.OdbcMembershipProvider" 
      connectionStringName="OdbcServices"
      enablePasswordRetrieval="true"
      enablePasswordReset="true"
      requiresQuestionAndAnswer="true" 
      writeExceptionsToEventLog="true" />
  </providers>
</membership>

Extra

NET 2.0

ASP.NET 2.0

Related

https://stackoverflow.com/questions/5834269/moving-asp-net-membership-specific-makings-to-a-separate-config-file> 移除具体作为成员的特定环境,单独编织文件

最佳回答

是的。 我们已经成功这样做。

你们可以以几种方式这样做,一种是把你所需要的任何财产引入供应商的榜样(例如,你正在使用<代码>)。 Sql MembershipProvider,并表明你如何注入连接线,但你可以看的来源。 Odbc MembershipProvider to have an concept where to do this yourself:

public static void InjectConnectionStringIntoSqlMembershipProvider(SqlMembershipProvider provider, string connectionString) {
    Type t = typeof(SqlMembershipProvider);
    FieldInfo fi = t.GetField("_sqlConnectionString", BindingFlags.NonPublic | BindingFlags.Instance);
    if (fi == null) throw new InvalidOperationException("Invalid private identifier.");
    fi.SetValue(provider, connectionString);
}

或者,你可以创建一个继承<代码> 会员资格/代码”的班子,创建自己的供应商。

或者,正如“Andomar”所显示的,你可以继承<代码>“成员提供”/代码(例如<代码>Sql MembersshipProvider等)的任何执行,以获得你想要的东西。

多年来,我们根据需要多少定制,做了所有三方面的工作。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签