Winforms中的用户凭据 [英] User Credentials in Winforms

查看:95
本文介绍了Winforms中的用户凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用c#winforms.now我开发了一个应用程序。那里有4个用户和1个管理员角色。我的疑问是如何使用sql表从管理员角色授予用户权限进行插入和更新操作



你能帮助我吗???

Hi,
I am using c# winforms.now i developed one application. there are 4 user and 1 admin role is there. my doubt is how to give user rights to do insert and update operations from the admin role using sql tables

can u help me anyone???

推荐答案

你应该去那里 - [使用Windows身份验证对用户进行身份验证] [ ^ ]了解如何使用Windows身份验证对用户进行身份验证。



另请查看CP文章:使用表单身份验证进行Windows身份验证 [ ^ ]



另请阅读关于CP的好答案:请告诉我什么是Windows身份验证以及表单身份验证和Windows身份验证之间的区别 [< a href =http://www.codeproject.com/Questions/333384/Plz-tell-me-what-is-windows-authentication-and-diftarget =_ blanktitle =New Window> ^ ]
You should go there-[Authenticating Users with Windows Authentication][^] to learn how to authenticate user with windows authentication.

Also have a look on CP article: Windows Authentication Using Form Authentication[^]

Also read a good answer on CP: Plz tell me what is windows authentication and difference between form authentication and windows authentication[^]


首先在SQL中创建两个具有所需权限的独立角色。



接下来你需要一个方法区分SQL中的用户。这通常是通过控制连接到SQL的用户来完成的。



您可以使用Windows凭据或SQL凭据。



使用Windows凭据,操作系统的用户名将传递给SQL。



使用SQL凭据,您可以在连接字符串中指定用户名。



然后您需要将相应的用户添加到您之前创建的组中。



这将在SQL级别停止用户进行他们不允许的更改。
First you create two separate roles in SQL with the required permissions.

Next you need a way to differentiate between your users within SQL. This is normally done by controlling the user that is connecting to SQL.

You can use either windows credentials or SQL credentials for this.

With windows credentials the username from the operating system is passed through to SQL.

With SQL credentials you specify the username in the connection string.

You then need to add the appropriate users to the groups you created earlier.

This will stop users, at the SQL level, making changes they're not allowed to make.


这篇关于Winforms中的用户凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆