使用 C# ASP.NET 访问网络共享
我在尝试使用 C# 和 ASP.NET 基于 Web 的应用程序访问网络共享时遇到问题。我使用 LDAP Active Directory 执行登录,并且有一种方法可以从指定目录读取文件并执行文件移动。该目录共享给特定用户,我无法访问它们,除非它们共享给“Everyone”组(这不是我们想要设置安全性的方式)。我想以某种方式使用 AD 登录上的用户名访问目录。这可能吗?我一直在研究目录安全类,但到目前为止还没有运气。谢谢。
I am having issues trying to access network shares using C# and ASP.NET web based application. I use LDAP Active Directory to perform the login and I have a method that reads files from a specified directory and performs file moves. The directory is shared to specific users and I am unable to access them unless they are shared to the "Everyone" group (which is not how we want to set the security). I would like to access the directories using the username on my AD login somehow. Is this possible? I have been looking into the Directory Security class but no luck so far. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将 web.config 文件上的模拟更改为具有共享访问权限的用户
Change the impersonation on your web.config file to a user that have access permission to the share
有两种方法可以解决此问题:授予用户应用程序池朗姆酒访问共享的权限,或者在需要访问共享时模拟 AD 用户
There's two ways to solve this grant the User the app pool rums under access to the share or impersonate the AD user when you need to access the share