Function 測(cè)網(wǎng)(url)
On Error Resume Next
cmdping = "ping " & url & " -n 1"
Set oExec = CreateObject("Wscript.shell").exec(cmdping)
Do Until oExec.stdout.AtEndOfStream
strline = strline & oExec.stdout.readline() & Chr(13)
Loop
測(cè)網(wǎng) = 0
If InStr(strline, "回復(fù)") Then 測(cè)網(wǎng) = 1
Set oExec = Nothing
End Function
Function 聯(lián)網(wǎng)提示(url)
If 測(cè)網(wǎng)(url) = 0 Then
tip = Time & " 請(qǐng)確認(rèn)是否連接上公司內(nèi)網(wǎng)。"
Debug.Print tip
MsgBox tip
End
End If
End Function