在C#中使用wmi查询多台计算机 [英] Querying multiple computer with wmi in C#

查看:72
本文介绍了在C#中使用wmi查询多台计算机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过用户名和密码获取多个计算机硬盘信息,任何人都可以知道如何通过wmi查询获得多个系统。

我只获得单个遥控器系统信息我想要多个可以有些想法



我尝试过:



硬盘驱动器信息非单台计算机多台计算机IN conosle应用程序

I m trying to get multiple Computer hard-drive information with the help of username and password can anyone have any idea how to get multiple system through wmi-query .
I m getting only single remote system infomartion i want multiple can some have idea

What I have tried:

Hard-drive Information Not Single computer Multiple Computer IN conosle application

推荐答案

使用绿色的改善问题链接编辑您的问题并添加来自评论以及您迄今为止所尝试的内容,包括WMI调用。这使得帮助更容易。



但是,您似乎在存储和检索所需数据时遇到问题(包含每个用户名和密码的系统列表)。您可以使用Config部分或提供多个值作为单独的字符串(例如key =systemname,value =systemname,user,password)并在检索后拆分该字符串。例如,参见这个SO线程: .net - 如何在C#app.config文件中读取多个值? - 堆栈溢出 [ ^ ]。



另见如何使用Visual C#从应用程序配置文件中存储和检索自定义信息 [ ^ ]
Use the green "Improve question" link to edit your question and add the information from the comments and what you have tried so far including the WMI call. That makes it much easier to help.

However, it seems that you have problems to store and retrieve the required data (list of systems with each username and password). You can use Config sections for that or provide multiple values as separated string (e.g. key="systemname", value="systemname,user,password") and split that string after retrieving it. See for example this SO thread: .net - How to read multiple values in C# app.config file? - Stack Overflow[^].

See also How to store and retrieve custom information from an application configuration file by using Visual C#[^]


这篇关于在C#中使用wmi查询多台计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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