Process.GetProcessById如何传递凭据
我需要查明进程是否在远程计算机上运行,我知道进程 ID 和远程电脑 IP。怎么做呢? 我已尝试下面的代码,但找不到传递凭据以登录远程计算机的方法。使用下面的代码,我的访问按预期被拒绝。
Process engineProcess = Process.GetProcessById(PID, IP);
问候, 托马斯
I need to find out is Process is running on remote machine or not, I know process id and remote pc ip. How to do that?
I have tried code below but do not find way to pass credentials to login to remote machine. Using code below I get access denied as expected.
Process engineProcess = Process.GetProcessById(PID, IP);
Regards,
Tomas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试通过模拟更改当前线程的身份的一种方法。以下是如何实现的示例:
http://support.microsoft.com/kb/306158< /a>
查看“在代码中模拟特定用户”部分
One way you could try it by changing the Identity of current thread by impersonating. here is an example of how to implement such:
http://support.microsoft.com/kb/306158
look under the section "Impersonate a Specific User in Code"