网络机器上的FileSystemWatcher设置凭据 [英] FileSystemWatcher on a network machine setting credential

查看:66
本文介绍了网络机器上的FileSystemWatcher设置凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以为filesystemwatcher对象设置凭据?

Is there a way to set a credential for a filesystemwatcher object?

该应用程序在无法访问网络计算机上目录的其他用户上运行,但我想为filesystemwatcher对象提供凭据,以便它可以侦听该目录.

The application runs on a different user that doesnt have access to directory on network machine but i want to give credentials to filesystemwatcher object so it can listen that directory.

这可行吗?

推荐答案

否.只需确保您的应用程序在具有访问您要访问的资源的正确特权的帐户下运行即可.

No. Just make sure that your application runs under an account that has the correct privileges to access the resources you want to access.

您可能想查看以下StackOverflow答案,该答案显示了在使用FileSystemWatcher时如何模拟另一个用户帐户:

You might want to check out the following StackOverflow answer which shows how you can impersonate another user account when using the FileSystemWatcher:

在模拟用户下运行的FileSystemWatcher

这篇关于网络机器上的FileSystemWatcher设置凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆