3

我正在尝试在远程机器上创建一个文件,但我收到“找不到网络名称”。我检查了网络路径,并且能够从我的机器访问该路径。你能告诉我有什么问题吗?

这是我的代码。

        using (StreamWriter sw = new StreamWriter("\\\\servername\\TEST1\\TEST\\NEWFILE.csv", true))
    {
        sw.WriteLine(sw);
    }
4

3 回答 3

1

Go to \servername\TEST1 and give write permission to the user or aspnet (if you have a web application) on test folder and then re-run your program. It will work.

To give write permissions, just refer to this article:
How to share a folder/File

In case it still does not work, replace servername with server IP address and do the same as stated above.

于 2012-04-11T15:29:45.240 回答
0

这肯定是一个安全问题。您需要授予远程计算机的写入权限

于 2012-09-01T19:49:10.097 回答
0

向运行此应用程序的用户授予访问权限,它是 IIS 池或 Windows 服务等

于 2012-04-11T14:48:27.477 回答