ASP.NET 自定义 MembershipProvider
我有一个客户端服务器应用程序。客户端是一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,所以我想通了。
我不需要连接字符串或任何东西。我所要做的就是:
我终于意识到上面的元素必须位于 <<系统.web >元素并修复了它,感谢您的帮助。
OK so i figured it out.
I don't need a connection string or anything. All i had to do was put:
I finally realized that the element above has to be inside the < system.web > element and that fixed it, thanks for your help.
希望您觉得这篇文章有用。
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).