Sends a UDP datagram to a specified port on a specified remote host.
Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Net.Sockets
public class MainClass
Shared Sub Main()
Dim udpClient As New UdpClient()
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes("test")
Try
udpClient.Send(sendBytes, sendBytes.Length, "www.domain.com", 11000)
Catch e As Exception
Console.WriteLine(e.ToString())
End Try
End Sub
End Class
Related examples in the same category