Private Sub Command1_Click() Comm1.Output = txtsend.Text End Sub Private Sub Command2_Click() Txtre
1个回答
展开全部
复制下面的代码
Private Sub Command1_Click()
Winsock1.SendData txtSend.Text
End Sub
Private Sub Form_Load()
Command2.Caption = "连接"
End Sub
Private Sub Command2_Click()
If Len(Text4.Text) = 0 Or Val(Text4.Text) > 65535 Then
MsgBox "请输入正确的端口号"
Exit Sub
End If
Dim my As String
Winsock1.Protocol = sckUDPProtocol '设置为UDP协义
Winsock1.LocalPort = Text4.Text
Winsock1.RemotePort = Text4.Text
Winsock1.RemoteHost = Text3.Text
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) > 9 And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub Command1_Click()
Winsock1.SendData txtSend.Text
End Sub
Private Sub Form_Load()
Command2.Caption = "连接"
End Sub
Private Sub Command2_Click()
If Len(Text4.Text) = 0 Or Val(Text4.Text) > 65535 Then
MsgBox "请输入正确的端口号"
Exit Sub
End If
Dim my As String
Winsock1.Protocol = sckUDPProtocol '设置为UDP协义
Winsock1.LocalPort = Text4.Text
Winsock1.RemotePort = Text4.Text
Winsock1.RemoteHost = Text3.Text
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) > 9 And KeyAscii <> 8 Then KeyAscii = 0
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询