简体   繁体   English

获胜表格,注册表

[英]Win Form, Registration form

I'm wondering if someone can point me in the direction of some online resource for the following problem, I've tried to search for terms but not getting any hits.我想知道是否有人可以为我指出以下问题的一些在线资源的方向,我试图搜索术语但没有得到任何结果。

I'm wondering how to create a C# forms application, that will connect to a database (SQL/Azure(Maybe) but I want the users to be able to register themselves. Therefore the application surely will need some sort of "Embedded" login for the users to be able to register.我想知道如何创建一个 C# forms 应用程序,它将连接到数据库(SQL/Azure(可能),但我希望用户能够自行注册。因此该应用程序肯定需要某种“嵌入式”登录以便用户能够注册。

I know in the web app variant, the app.config file is protected and ideal for holding connection strings and the like but i'm unaware of anything like this for form type applications.我知道在 web 应用程序变体中,app.config 文件受到保护并且非常适合保存连接字符串等,但我不知道表单类型应用程序有这样的事情。

Things I thought may work...我认为可能有用的东西......

1, Create an DB account with limited functionality (This would be the embedded login/user) that has access to the "create user" proc only. 1,创建一个功能有限的数据库帐户(这将是嵌入式登录名/用户),只能访问“创建用户”过程。 Then once registered the user has to authenticate again for the app for effectively work.然后,一旦注册,用户必须再次为应用程序进行身份验证才能有效工作。

2, Embed a single user account in the app which acts as the only connection between app and database all the time and create a user table, which the user adds too. 2,在应用程序中嵌入一个用户帐户,始终充当应用程序和数据库之间的唯一连接,并创建一个用户表,用户也添加该表。 Then design a privilege system within the database and the associated user.然后在数据库和关联用户中设计一个权限系统。 Similar to the web.app approach.类似于 web.app 方法。

Finally, if the links or help doesn't cover it.最后,如果链接或帮助没有涵盖它。 Would it be better to create Logins/Users (which could get very large) or create fewer logins/user and manage it through a table/privelge system within the database?创建登录名/用户(可能会变得非常大)或创建更少的登录名/用户并通过数据库中的表/权限系统对其进行管理会更好吗?

Thanks谢谢

Personally I would take advantage of the asp.net built in registration process.我个人会利用 asp.net 内置的注册流程。

Design the app with multiple layers.设计具有多层的应用程序。

  • UI (winForm) The main app with login form only. UI (winForm) 仅具有登录表单的主应用程序。
  • UI (Web) for registration purposes only. UI(Web)仅用于注册目的。
  • WebApi for access to data etc.. WebApi 用于访问数据等。
  • Data for access to your data, EF, Nhibernate, SQL etc..用于访问您的数据的数据,EF、Nhibernate、SQL 等。

This tutorial from Microsoft shows how to build the registration pages that includes registration and confirmation email process, password resets etc.. Microsoft 的本教程展示了如何构建注册页面,包括注册和确认 email 过程、密码重置等。

Then in the WinForms application you only need a login screen, as shown in this tutorial然后在 WinForms 应用程序中你只需要一个登录屏幕,如本教程所示

It might sound like more work, but you really win a lot using the provided web functionality, for example if you need to download the WinForms app from a website you can have a user register first before downloading the app.这听起来可能需要更多工作,但使用提供的 web 功能,您确实收获颇丰,例如,如果您需要从网站下载 WinForms 应用程序,您可以让用户先注册,然后再下载该应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM