我有一个c#winform应用程序,它在本地帐户下运行,但需要监视域上的文件夹.我使用 here稍微修改过的代码来复制文件,工作正常.可以使用类似的代码与FileSystemWatcher设置模拟,以便我可以监控
using ( new Impersonator( "myUsername", "myDomainname", "myPassword" ) )
{
...
<code that executes under the new context>
...
}
