i work with c++ programming, I use an example for understanding main of my question.
Suppose, we want get current username in windows operation system, we can use follow code :
#include <windows.h>
#include <Lmcons.h>
char username[UNLEN+1];
DWORD username_len = UNLEN+1;
GetUserName(username, &username_len);
also, we can use wmi by follow the instruction explained on here and use Win32_ComputerSystem.UserName .
so, I hope you have fully understood, what's different between wmi and using api or any other way?
tank you for your response.
disadvantage :
advantage :
These are the most important issues for using wmi.
Windows Management Instrumentation (WMI) is a set of specifications from Microsoft for consolidating the management of devices and applications in a network from Windows computing systems.
It is Microsoft implementation of Web-Based Enterprise Management. WMI - Services are installed on Windows OS, but the service can be turned off. So if user disabled the service you wont get any information about the system. It is just for reporting purpose.
Whereas the APIs are ways thru which the Microsoft provides the access to the information to local Application and some how you can also manipulate the information provided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With