试试这样
Dim ip As String
Dim ipFile As String = ProjectPath & "ip.txt"
If Filesys.FileExists(ipFile) Then
ip = FileSys.ReadAllText(ipFile)
End If
If Network.Ping("192.168.1.74",1000) OrElse (ip > "" AndAlso Network.Ping(ip,1000)) Then
Dim y As Integer = Date.Today.Year
Dim m As Integer = Date.Today.Month
Dim dt4 As New Date(y, m, 1)
Dim dt5 As new Date(y,m,Date.DaysInMonth(y,m))
DataTables("报销明细表").LoadFilter = "申请日期 >= '" & dt4 & "' and 申请日期 <= '" & dt5 & "'"
DataTables("报销明细表").Load
Forms("费用查询").open
Else
MessageBox.show("网络不通请重新操作!")
End If