KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I will like to find some result after this query, but in the beginning of the foreach loop, the error "invalid class" occur. string wmiQuery = string.Format("SELECT * FROM Win32_Process"); var searcher = new ManagementObjectSearcher(wmiQuery); var wmiResults = searcher.Get(); foreach (ManagementObject retObject in wmiResults) { Console.WriteLine("[{0}]\tName: {1}", retObject["ProcessID"], retObject["Name"]); } I use window 7 64, and i wonder if Win32_Process exists. I also use wmi code creator download it from http://www.microsoft.com/downloads/en/details.aspx?familyid=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en but i dont find any Win32_Process. Somebody has an idea ?
Tags (comma-separated)
Save Edits
Cancel