原文:http://stackoverflow.com/questions/10196811/directory-exists-not-working-for-a-network-path
When you run the code in IIS it runs in the identity of the Application Pool which by default is the built in user "Network Service" this is a local user account which does not have access outside the local machine.
The rights on the network share are the first layer, after that the NTFS rights on the directory are checked.
You need to change the identity of the application pool to a domain user with the same rights as your user.
web站点向另一台server上传文件时,访问无权限,可能由以下原因造成:
iis的应用程序池(Application Pool)的身份(Identity)是"Network Service", 这个本地用户是不能访问外部机器的,
因此需要把应用程序池(Application Pool)的身份(Identity)改成可访问外部网络的用户。