Asp.net 访问网络共享

编程入门 行业动态 更新时间:2024-10-20 05:42:33
本文介绍了Asp 访问网络共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 ASP.NET 应用程序,需要将文件保存到网络共享 (Samba).

I have an ASP.NET app which needs to save files to a network share (Samba).

共享需要用户名和密码才能连接.

The share requires a username and password to connect.

我已将永久驱动器映射到共享并提供登录凭据,同时以 DOMAINWEBUSER 身份登录到服务器.

I have mapped a persistent drive to the share and provided the login credentials whilst logged in to the server as DOMAINWEBUSER.

我已更改托管我的应用程序的虚拟目录,以使用 DOMAINWEBUSER 帐户而不是 IWAM 帐户.

I have changed the virtual directory which hosts my app to use the DOMAINWEBUSER account instead of the IWAM account.

但是用户仍然看不到映射的驱动器.

However the user still cannot see the mapped drive.

我错过了什么?

推荐答案

如果可以,最好使用 UNC,因为映射驱动器通常链接到交互式用户,并且虚拟目录可能正在连接服务或网络登录类型.

It is best to use the UNC if you can as the mapped drives generally are linked to the interactive user and the virtual directory is probably connecting with a service or netwrok login type.

此知识库文章中描述了另一个可能的修复方法将 IIS 配置为使用 Samba 网络共享时发生错误作为它的根.摘录如下.

Another possible fix is described in this KB articleError occurs when you configure IIS to use a Samba network share as its root. Excerpted below.

重要这些步骤可能会增加您的安全风险.这些步骤可能也使计算机或网络更容易受到恶意攻击用户或恶意软件,例如病毒.我们推荐的流程是这篇文章描述了启用程序按原样运行旨在或实施特定的程序能力.在你做之前这些变化,我们建议您评估相关风险通过在您的特定的环境.如果你决定要实施此过程,请采取任何适当的额外步骤来帮助保护系统.我们建议仅当您使用此过程时确实需要这个过程.

Important These steps may increase your security risk. These steps may also make the computer or the network more vulnerable to attack by malicious users or by malicious software such as viruses. We recommend the process that this article describes to enable programs to operate as they are designed to or to implement specific program capabilities. Before you make these changes, we recommend that you evaluate the risks that are associated with implementing this process in your particular environment. If you decide to implement this process, take any appropriate additional steps to help protect the system. We recommend that you use this process only if you really require this process.

警告此方法涉及安全风险,因为用户创建映射必须保持记录到本地控制台.所以,唯一的安全是通过锁定计算机.要解决此问题,执行以下操作:

Warning This method involves a security risk because the user who created the mapping must remain logged on to the local console. Therefore, the only security is by locking the computer. To work around this problem, do the following:

  • 使用root"将驱动器号映射到 servernameiisroot 并密码."
  • 在 Samba 虚拟目录中,将主目录从 Share 更改为在另一台计算机上到本地目录,然后指定驱动器您在第 1 步中映射的字母.
  • 重新启动网站,然后通过浏览对其进行测试.
  • 更多推荐

    Asp.net 访问网络共享

    本文发布于:2023-11-11 07:30:54,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1577771.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:网络   Asp   net

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!