vb.net udp接收失败

venus9008 2006-01-10 09:45:33
udp接收的时候报错
Sub listen()
Dim ip As System.Net.IPAddress = System.Net.IPAddress.Parse("192.168.20.255")
Dim port As Integer = 5689
Dim ipep As New System.Net.IPEndPoint(ip, port)
Dim myudp As New System.Net.Sockets.UdpClient
Dim bytes As Byte()
Try
bytes = myudp.Receive(ipep)'在这里报错,’提供了一个无效的参数‘
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub

请指教~~!
...全文
165 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Sunny_Girl_1981 2006-03-09
  • 打赏
  • 举报
回复
udp接收的时候报错
Sub listen()
Dim ip As System.Net.IPAddress = System.Net.IPAddress.Parse("192.168.20.255")
Dim port As Integer = 5689
Dim ipep As New System.Net.IPEndPoint(ip, port)
Dim myudp As New System.Net.Sockets.UdpClient---------------在这里添加端口号试一下,比如(1234)
Dim bytes As Byte()
Try
bytes = myudp.Receive(ipep)'在这里报错,’提供了一个无效的参数‘
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub

16,556

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧