作者clarkandsam (丁力)
看板Visual_Basic
標題[VB6 ] 網路傳送訊息的問題
時間Wed Nov 30 02:08:17 2005
我這裡有一段程式碼
用來連線跟傳送訊號
Private Sub Command2_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
Winsock1.Close
Winsock1.RemoteHost = c1
Winsock1.RemotePort = 3347
DoEvents
Winsock1.Connect
End Sub
----------------------------------------------------------------------------
Private Sub Command2_MouseUp(Button As Integer, Shift As Integer,
X As Single, Y As Single)
If Winsock1.State = sckConnected Then Winsock1.SendData Text1.Text
End Sub
----------------------------------------------------------------------------
我不想利用按鍵的壓下跟彈起
我想把他寫在同一個程式迴圈內
我嘗試過
Winsock1.Close
Winsock1.RemoteHost = c1
Winsock1.RemotePort = 3347
DoEvents
Winsock1.Connect
If Winsock1.State = sckConnected Then Winsock1.SendData Text1.Text
但是這樣還是無法送出訊號
在中間加入暫停也無法順利動作
拜託各位
能否幫小弟解決這個問題
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.111.79.32