作者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