ASP.NET 自定义 MembershipProvider

发布于 2024-08-24 21:43:56 字数 331 浏览 8 评论 0原文

我有一个客户端服务器应用程序。客户端是一个 asp.net c# 站点,服务器只是一个 c# 命令行应用程序。我计划使用 .NET 远程处理来访问和公开服务器应用程序上的信息,并将其预设给查看客户端的用户。

服务器应用程序具有我想用于通过 asp.net 登录控件等进行身份验证的用户对象。

我实现创建了一个自定义类“MyMembershipProvider”,它实现了 MembershipProvider,但我现在感到非常困惑。接下来我该怎么办?

我知道我需要使用“成员资格”节点更新 Web.config,但我见过的所有示例都引用了连接字符串,我的示例不需要连接字符串,因为它不会使用数据库等。

I have a client server application. The client is an asp.net c# site and the server is simply a command line application in c#. I plan on using .NET remoting to access and expose information that is on the server application and preset it to the user viewing the client.

The server application has user objects that i want to use for authentication with the asp.net login controls etc.

I implemented created a custom class "MyMembershipProvider" which implements MembershipProvider but i'm getting very confused now. What do i do next?

i know i need to update the Web.config with a "membership" node but all the examples i've seen have a reference to a connection string, mine does not need a connection string as it will not be using a database etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乄_柒ぐ汐 2024-08-31 21:43:56

好的,所以我想通了。

我不需要连接字符串或任何东西。我所要做的就是:

<membership defaultProvider="Name of the class that you created that implements the MembershipProvider class">
  <providers>
    <clear/>
    <add
      name="Name of the class that you created that implements the MembershipProvider clas"
      type="fully qualified name of the class that you created that implements the MembershipProvider class" />
  </providers>
</membership>

我终于意识到上面的元素必须位于 <<系统.web >元素并修复了它,感谢您的帮助。

OK so i figured it out.

I don't need a connection string or anything. All i had to do was put:

<membership defaultProvider="Name of the class that you created that implements the MembershipProvider class">
  <providers>
    <clear/>
    <add
      name="Name of the class that you created that implements the MembershipProvider clas"
      type="fully qualified name of the class that you created that implements the MembershipProvider class" />
  </providers>
</membership>

I finally realized that the element above has to be inside the < system.web > element and that fixed it, thanks for your help.

梦萦几度 2024-08-31 21:43:56

希望您觉得这篇文章有用。

http://learn.iis.net/page.aspx/528/how-to-use-the-sample-read-only-xml-membership-and-role-providers-with -iis-70/

您需要更好地理解为什么 web.config 需要某种配置,因为那些基于数据库的提供程序有理由在 web.config 中使用连接字符串。然后您知道如何配置您的提供程序(没有连接字符串,因为您的提供程序不使用数据库)。

Hope you find this article useful.

http://learn.iis.net/page.aspx/528/how-to-use-the-sample-read-only-xml-membership-and-role-providers-with-iis-70/

You need to better understand why web.config needs a certain configuration, as those database based providers have a reason to use connection strings in web.config. Then you know how to configure your provider (without a connection string as yours does not use database).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文