10Try
11If IP"" Then
12Dim tcpc As New System.Net.Sockets.TcpClient(IP, 5656)
13Dim tcpStream As Net.Sockets.NetworkStream = tcpc.GetStream
14Dim reqStream As New IO.StreamWriter(tcpStream)
15reqStream.Write(SendMsg)
16reqStream.Flush()
17tcpStream.Close()
18tcpc.Close()
19End If
20Catch ex As Exception
21MsgBox(ex.Message.ToString)
22End Try
23End Sub
24Private Sub MyListen()Sub MyListen()
25Try
26Dim ipAddress As System.Net.IPAddress = System.Net.Dns.Resolve(System.Net.Dns.GetHostName).AddressList(0)
27tcpl = New System.Net.Sockets.TcpListener(ipAddress, 5656)
28tcpl.Start()
29While True
30Dim s As System.Net.Sockets.Socket = tcpl.AcceptSocket()
31Dim MyBuffer(1024) As Byte
32Dim i As Integer
33i = s.Receive(MyBuffer)
34If i0 Then
35Dim lstrRec As String
36Dim j As Integer
37For j = 0 To i - 1
38TextBox1.Text += Chr(MyBuffer(j))","
39Next
40End If
41End While
42Catch ex As Exception
43MsgBox(ex.Message.ToString)
44End Try
45End Sub
46
47Private Sub Button1_Click()Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
48SendMessage("192.168.0.61", TextBox2.Text)
49End Sub
【vb.net与力控通信 力控 access】vb.net与力控通信的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于力控 access、vb.net与力控通信的信息别忘了在本站进行查找喔 。
推荐阅读
- 个人简历模板下载,个人简历模板
- html注册表代码信息完整,用户注册表html代码
- 怎么知道电脑显卡多大,怎么看电脑显卡多大
- 钉钉直播时别人能说话吗,钉钉直播时别人能说话吗
- java素数的判断代码 java素数的判断条件
- 安卓手机仿真软下载,安卓仿真软件
- 怎么添加城市服务器路由器,怎么添加服务器网络位置
- 新媒体视频如何分类,新媒体视频格式常见的有
- linux日志清屏命令 linux中清除日志vi