你好,我已经编写了一个在 .net 中写入远程服务器文件的代码。当我将输出路径设置为本地驱动器时,代码可以正常工作并创建文件夹和文本文件。但是当我指向远程服务器时,出现以下错误:
System.UnauthorizedAccessException: Access to the path '\\ServerName\FolderTest\FolderTest1\AB.txt' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at ...
如果您需要额外的信息,请告诉我。