斷開連接提示
復(fù)制代碼 代碼如下:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" strComputer "\root\wmi")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("Select * from MSNdis_StatusMediaDisconnect")
Do While True
Set strLatestEvent = colMonitoredEvents.NextEvent
Wscript.Echo "A network connection has been lost:"
WScript.Echo strLatestEvent.InstanceName, Now
Wscript.Echo
Loop
建立連接提示
復(fù)制代碼 代碼如下:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" strComputer "\root\wmi")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("Select * from MSNdis_StatusMediaConnect")
Do While True
Set strLatestEvent = colMonitoredEvents.NextEvent
Wscript.Echo "A network connection has been made:"
WScript.Echo strLatestEvent.InstanceName, Now
Wscript.Echo
Loop
您可能感興趣的文章:- C#中判斷本地系統(tǒng)的網(wǎng)絡(luò)連接狀態(tài)的方法
- android 檢查網(wǎng)絡(luò)連接狀態(tài)實現(xiàn)步驟
- c#判斷網(wǎng)絡(luò)連接狀態(tài)