通过C#访问passowrd保护共享文件夹 [英] Access passowrd protect shared folder through C#

查看:136
本文介绍了通过C#访问passowrd保护共享文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想知道是否有任何特定方法可以访问存储在共享密码保护的文件夹中的数据库.我想通过在程序本身中提供用户名和密码来访问该文件夹.

C#或VB6中的解决方案(如果可能)将真的是最好的选择.

谢谢

AJ

Hi
I would like to know if there is any particular way to access a database which is stored in a shared-password-protected folder. I would like to access the folder by providing the username and password in the program itself.

The solution in either C# or VB6 (if possible) would be really the best thing...

Thank you

AJ

推荐答案

如果可能的话,这将是一个非常薄弱的​​保护措施.头脑清晰的人不会在任何地方存储未加密的密码-身份验证永远不需要它们.


要了解如何存储身份验证(这是您的第二个问题),请学习Assymetric加密: http://en.wikipedia. org/wiki/Assymetric_key_cryptography [ ^ ]以及作为RSA: http://en.wikipedia.org/wiki/RSA [
If it would be possible, it would be a very weak protection. Nobody in clear mind won''t store non-ciphered passwords anywhere — they are never needed for authentication.


To understand how to store authentication (it that is what your second question is about), learn Assymetric ciphering: http://en.wikipedia.org/wiki/Assymetric_key_cryptography[^], as well as RSA: http://en.wikipedia.org/wiki/RSA[^]. It will give you a good idea. Why RSA? One reason is: it is fully implemented in .NET, see System.Security.Cryptography.RSA.

—SA


如果您在Windows环境中,则应通过Active Directory处理访问权限.正如SA所指出的,没有理由在程序中存储密码或用户名.

也是另一回事.是数据库访问吗?如果不是这样的话(例如SQL Server),那么您就不需要(或者确切地说,您必须没有权限)访问包含数据库的文件夹.
If you''re in a Windows environment the access privileges should be handled via Active Directory. As SA pointed out, no reason to store passwords or user names in programs.

Also another thing. Is the database Access? If not and it''s for example SQL Server then you don''t need (or to be precise you must not have) access to the folders containing the database.


这篇关于通过C#访问passowrd保护共享文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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