是的,我也知道用定时器,我是问能否给个具体点的代码?我现在用的就是定时器,不过一连街就报错Select Case Winsock1.State Case 1 Case 2 Case 3 Case 4 Case 5 Case 6 Case 7 End Select If Winsock1.State <> 7 Then Winsock1.Connect,当执行Winsock1.Connect时就报错,有哪位朋友知道原因,请帮帮忙!
Private Sub Timer1_Timer() If Winsock1.State <> sckConnected _ And Winsock1.State <> sckConnecting Then Winsock1.Connect "10.7.3.154" End If If Winsock1.State = sckConnected Then Label2.Caption = "连接" Else
Case 1
Case 2
Case 3
Case 4
Case 5
Case 6
Case 7
End Select
If Winsock1.State <> 7 Then Winsock1.Connect,当执行Winsock1.Connect时就报错,有哪位朋友知道原因,请帮帮忙!
If Winsock1.State <> sckConnected _
And Winsock1.State <> sckConnecting Then
Winsock1.Connect "10.7.3.154"
End If
If Winsock1.State = sckConnected Then
Label2.Caption = "连接"
Else
Label2.Caption = "断开"
End If
End Sub