Windowsサービスを使用してサーバーパス上でファイルウォッチャーを実行しようとしています。Windowsログインクレデンシャルを使用してサービスを実行しており、ログインからこの「someServerPath」にアクセスできます。しかし、FileSystemWatcherからそれを行うと、次のようにスローされます。
ディレクトリ名\someServerPathが無効です"例外。
var fileWatcher = new FileSystemWatcher(GetServerPath())
{
NotifyFilter=(NotifyFilters.LastWrite|NotifyFilters.FileName),
EnableRaisingEvents=true,
IncludeSubdirectories=true
};
public static string GetServerPath()
{
return string.Format(@"\\{0}", FileServer1);
}
誰かがこれを手伝ってくれませんか?