[PHP] 纯文本查看 复制代码 Option Explicit
Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
Private Sub Form_Load()
Dim isConnected As Long
Dim urlToCheck As String
Dim ret As Long
urlToCheck = "https://www.qq.com"
ret = InternetCheckConnection(urlToCheck, 1, 0)
If ret <> 0 Then
If Dir(App.Path & "\X.exe") <> "" Then
Shell App.Path & "\X.exe"
Unload Me
Else
MsgBox "文件X.exe不存在,请检查。", vbExclamation
Unload Me
End If
Else
MsgBox "当前未接入互联网,请检查网络连接后重试。", vbExclamation
Unload Me
End If
End Sub |