‘监控源码 进程:
colMonitoredProcesses = objWMIService.对象型方法 (“ExecNotificationQuery”, “select * from __instancecreationevent within 1 where TargetInstance isa 'Win32_Process'”)
‘自己尝试使用:(对象型方法里面的文本,是从VB找到的)
ISWbemObjectSet = objWMIService.对象型方法 (“ExecQuery”, “Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE”)
'Select * from Win32_NetworkAdapterConfiguration
ISWbemObject = ISWbemObjectSet.对象型方法 (“ItemIndex”, 0)
调试输出 (ISWbemObject.文本方法 (“GetObjectText_”, 0))
可以获取到网卡相关信息。
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
' Obtain an instance of the the class
' using a key property value.
Set objShare = objWMIService.Get("Win32_NetworkAdapterConfiguration.Index='1'")
' Obtain an InParameters object specific
' to the method.
Set objInParam = objShare.Methods_("EnableStatic"). _
inParameters.SpawnInstance_()
' Execute the method and obtain the return status.
' The OutParameters object in objOutParams
' is created by the provider.
Set objOutParams = objWMIService.ExecMethod("Win32_NetworkAdapterConfiguration.Index='1'", "EnableStatic", objInParam)