c#实现"扫描检测硬件改动"
2021-06-03 01:03
标签:硬件 war 扫描 overflow mgr last extern device err 调用方法: 参考链接: https://stackoverflow.com/questions/2181525/is-there-an-api-call-to-start-a-scan-for-hardware-devices c#实现"扫描检测硬件改动" 标签:硬件 war 扫描 overflow mgr last extern device err 原文地址:https://www.cnblogs.com/sherlock-merlin/p/10925310.htmlpublic static class Win32Api
{
public const int CM_LOCATE_DEVNODE_NORMAL = 0x00000000;
public const int CM_REENUMERATE_NORMAL = 0x00000000;
public const int CR_SUCCESS = 0x00000000;
[DllImport("CfgMgr32.dll", SetLastError=true)]
public static extern int CM_Locate_DevNodeA(ref int pdnDevInst, string pDeviceID, int ulFlags);
[DllImport("CfgMgr32.dll", SetLastError=true)]
public static extern int CM_Reenumerate_DevNode(int dnDevInst, int ulFlags);
}
int pdnDevInst = 0;
Win32Api.CM_Locate_DevNodeA(ref pdnDevInst, null, Win32Api.CM_LOCATE_DEVNODE_NORMAL);
Win32Api.CM_Reenumerate_DevNode(pdnDevInst, Win32Api.CM_REENUMERATE_NORMAL);
上一篇:关于String处理的一些api
文章标题:c#实现"扫描检测硬件改动"
文章链接:http://soscw.com/index.php/essay/89946.html