IIS虚拟目录映射到网络驱动器(带驱动器号)但无法创建文件 [英] IIS Virtual Directory map to network drive (with drive letter) but fail to create file

查看:1231
本文介绍了IIS虚拟目录映射到网络驱动器(带驱动器号)但无法创建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows Server 2003上使用C#/ ASP.NET,IIS6。

I am using C#/ASP.NET, IIS6 on Windows Server 2003.


  1. 将数据服务器共享文件夹映射到带有驱动程序字母V的WebServer:\

  1. Map the data server shared folder to the WebServer with driver letter V:\

在WebServer上,IIS创建了一个虚拟目录,并使用V:\指向本地位置。由于没有'Connect As',因此不确定将使用哪个USER

On the WebServer, IIS created a virtual directory and pointed to 'local location' with V:\ . Since there is no 'Connect As', not sure which USER will be used

在我的WebMethod中,我想在FileStream的共享文件夹上创建文件。写()。

In my WebMethod, I want to create file on the shared folder with FileStream.Write().

我在动作上有IO异常,有任何提示吗?

I got IO Exception on the action, any hint?

PS我在数据服务器共享文件夹上添加了ASPNET / NETWORK SERVICE。

P.S. I have added ASPNET/NETWORK SERVICE on the data server shared folder.

谢谢!
Gavin

thanks! Gavin

推荐答案

映射的网络驱动器特定于创建它们的用户帐户:

Mapped network drives are specific to the user account that created them:


使用带有IIS的映射驱动器 - MS KB257174

访问远程计算机上存在的Web服务器内容的首选方法是使用遵循通用命名约定(UNC)的共享。

很可能网络服务(或者如果你在模拟下运行ASP.NET,站点匿名帐户没有这个映射。

It's very likely that NETWORK SERVICE (or if you're running ASP.NET under impersonation, the site anonymous account) hasn't got this mapping.

要更改虚拟目录指向的位置,请浏览到在IIS管理器中,右键单击虚拟目录并选择属性。然后,您可以选择位于另一台计算机上的A共享

To change the location where the virtual directory points to, browse to your site in IIS manager, right click on the virtual directory and select properties. You can then select "A share located on another computer":

这篇关于IIS虚拟目录映射到网络驱动器(带驱动器号)但无法创建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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