0

I have a windows service that I built in C#. The purpose of the Windows Service is to synchronize two folders (Folder-A & Folder-B) between different servers using File System Watcher. Everything worked fine up until I moved Folder-A & Folder-B from the C drive to the D Drive. Now I can't map the folders and on the event log I get the "The local device name has a remembered connection to another network resource" error.

Also, the folders are shared and the credentials I use have full control rights to both folders.

4

1 回答 1

0

嗨,我终于解决了我在 C# 代码上必须做的所有事情,我不得不强制映射我的共享文件夹。这很奇怪,因为我第一次使用该服务时并没有让它映射。但是在将共享文件夹更改为另一个驱动器之后,我遇到了这个问题。

下面是强制映射的 C# 代码。

oNetDrive.Force = true;
oNetDrive.Persistent = true;

oNetDrive 驱动器是共享文件夹。Force 和 Persistent 是属性。

于 2013-10-16T08:08:43.070 回答