Click here to Skip to main content
15,887,336 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Updated 15-Jan-18 23:19pm
Comments
Jochen Arndt 16-Jan-18 3:14am    
Use a loop to query the information for each system from your list.
Member 13545401 16-Jan-18 3:48am    
hey jochen send loop code
Member 13545401 16-Jan-18 3:51am    
i used foreach to getting app.config file as follows
NameValueCollection sall;
sall = ConfigurationManager.AppSettings;
foreach (string s in sall.AllKeys)
{
//here what should i write i didn't undertsand
}
Jochen Arndt 16-Jan-18 4:19am    
You need a list of system names and for each system you need username and password. Assuming that these are stored in a list, use a loop to query the information.
Member 13545401 16-Jan-18 4:55am    
yes jochen in app.config i will store username and passowrd i.e in key= "username" value="user domiain name "again key="password" value="some password" and so on i will add max 7 system details ok and then i read this key pairs all with help of namevaluecollection class then store in appsettings in sall then use foreach for getting elemnts what i add in app.config but what should functionality i tell i don't know please give me a code jochen i m begginers in .net

1 solution

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#[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900