你可以在Windows应用程序中使用asp.net成员资格提供程序吗?

时间:2022-06-07 07:28:44

The Asp.Net membership provider has some clear uses in a web app. I am thinking about trying to leverage some of the features in a windows application (more specifically WPF). Does anyone know if it is possible to use the core features in a windows app? I am mostly just looking for it to create my database tables, and maintain users, roles, and profiles. I obviously do not need to use the built-in web controls (e.g. Login).

Asp.Net会员提供商在Web应用程序中有一些明确的用途。我正在考虑尝试利用Windows应用程序中的一些功能(更具体地说是WPF)。有谁知道是否有可能在Windows应用程序中使用核心功能?我主要只是在寻找它来创建我的数据库表,并维护用户,角色和配置文件。我显然不需要使用内置的Web控件(例如Login)。

4 个解决方案

#1


3  

I have a winform app that talks to DotNetNuke (DNN). DNN uses the Asp.net membership provider, so the source will work for other apps that use that membership provider as well. It's a very simple app, so you should be able to read the source easily.

我有一个与DotNetNuke(DNN)对话的winform应用程序。 DNN使用Asp.net会员提供商,因此该源也适用于使用该会员提供商的其他应用程序。这是一个非常简单的应用程序,因此您应该能够轻松阅读源代码。

http://www.datakido.com/downloads/Token/ViewInfo/ItemId/3

http://www.datakido.com/downloads/Token/ViewInfo/ItemId/3

You should be able to adapt the source to work with WPF.

您应该能够调整源代码以使用WPF。

#2


9  

Yes. Membership, roles and profiles are all features of Visual Studio 2008 Client Application Services (Services tab of a project properties)

是。成员身份,角色和配置文件是Visual Studio 2008客户端应用程序服务的所有功能(项目属性的“服务”选项卡)

http://msdn.microsoft.com/en-us/library/bb384297.aspx

http://msdn.microsoft.com/en-us/library/bb384297.aspx

http://channel9.msdn.com/posts/DanielMoth/Client-Application-Services-with-Visual-Studio-2008/

http://channel9.msdn.com/posts/DanielMoth/Client-Application-Services-with-Visual-Studio-2008/

#3


1  

Yes, you can.

是的你可以。

All the configuration can be done within app.config instead web.config of asp.net.

所有配置都可以在app.config中完成,而不是asp.net的web.config。

#4


0  

Make sure that you are creating a 3.5 application (WPF 4 won't work yet) - Then you must import the reference System.Web. This will allow you to use "using System.Web.Security;" like you normally would in a web app... now you can access stuff such as Membership.CreateUser()

确保您正在创建3.5应用程序(WPF 4尚不可用) - 然后您必须导入参考System.Web。这将允许您使用“using System.Web.Security;”就像你通常会在网络应用程序中...现在你可以访问诸如Membership.CreateUser()之类的东西

Your app.config file has to be configured for your provider along with a connection string.

必须为您的提供程序配置app.config文件以及连接字符串。

#1


3  

I have a winform app that talks to DotNetNuke (DNN). DNN uses the Asp.net membership provider, so the source will work for other apps that use that membership provider as well. It's a very simple app, so you should be able to read the source easily.

我有一个与DotNetNuke(DNN)对话的winform应用程序。 DNN使用Asp.net会员提供商,因此该源也适用于使用该会员提供商的其他应用程序。这是一个非常简单的应用程序,因此您应该能够轻松阅读源代码。

http://www.datakido.com/downloads/Token/ViewInfo/ItemId/3

http://www.datakido.com/downloads/Token/ViewInfo/ItemId/3

You should be able to adapt the source to work with WPF.

您应该能够调整源代码以使用WPF。

#2


9  

Yes. Membership, roles and profiles are all features of Visual Studio 2008 Client Application Services (Services tab of a project properties)

是。成员身份,角色和配置文件是Visual Studio 2008客户端应用程序服务的所有功能(项目属性的“服务”选项卡)

http://msdn.microsoft.com/en-us/library/bb384297.aspx

http://msdn.microsoft.com/en-us/library/bb384297.aspx

http://channel9.msdn.com/posts/DanielMoth/Client-Application-Services-with-Visual-Studio-2008/

http://channel9.msdn.com/posts/DanielMoth/Client-Application-Services-with-Visual-Studio-2008/

#3


1  

Yes, you can.

是的你可以。

All the configuration can be done within app.config instead web.config of asp.net.

所有配置都可以在app.config中完成,而不是asp.net的web.config。

#4


0  

Make sure that you are creating a 3.5 application (WPF 4 won't work yet) - Then you must import the reference System.Web. This will allow you to use "using System.Web.Security;" like you normally would in a web app... now you can access stuff such as Membership.CreateUser()

确保您正在创建3.5应用程序(WPF 4尚不可用) - 然后您必须导入参考System.Web。这将允许您使用“using System.Web.Security;”就像你通常会在网络应用程序中...现在你可以访问诸如Membership.CreateUser()之类的东西

Your app.config file has to be configured for your provider along with a connection string.

必须为您的提供程序配置app.config文件以及连接字符串。