如何将带有用户名和密码的服务器名称传递给C#中的process.getprocess [英] How to pass server name with username and password to the process.getprocess in C#
本文介绍了如何将带有用户名和密码的服务器名称传递给C#中的process.getprocess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将带有用户名和密码的服务器名称传递给Process.GetProcess在C#中。
我想看到当前进程在服务器机器上运行
我尝试了什么:
我尝试过使用ConnectionOption和管理范围,但它没有用。
那么可用的替代选项
How to pass server name with username and password to the Process.GetProcess In C#.
I want to see current process running on server machine
What I have tried:
I have tried using ConnectionOption and management scope but it doesn't worked.
So what will be the alternate option available
推荐答案
正如您之前所知,您无法在远程计算机上使用Process.GetProcess的凭据。您必须使用WMI查询来执行此操作。
您可以找到使用WMI执行此操作的示例这里 [ ^ ]。
As you've been told before, you cannot use credentials with Process.GetProcess on a remote machine. You MUST use a WMI query to do it.
You can find an example of using WMI to do this here[^].
这篇关于如何将带有用户名和密码的服务器名称传递给C#中的process.getprocess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文