简体   繁体   中英

can't use WMI Classes in C#

I hope you can help me out another time :)

I like to use the WMI Classes, such as ConnectionOptions, ManagementScope and so on, to reboot a remote Desktop. Anyway, I tried to include the System.Management thing but it still can´t find the classes and cause me to not to debug it...

using System.Management;

Does I need to install something first? oO I use Visual Studio 2012 on a windows 7 PC, the tool is made of a C# WPF Application...

Thank you so much for any help!

Try adding a reference to System.Management assembly. You don't need to install anything else.

After you write the code, it might be required that your app runs with elevated privileges in order for the WMI functionality to actually work when calling it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM