Imports System.Net.Sockets
Imports System.Text
Imports System.IO
Public Class Tester
Public Shared Sub Main
Try
Dim dataSend() As Byte
Dim myUdpClient As UdpClient = New UdpClient("127.0.0.1", 12345)
Dim myFilestream As FileStream
myFilestream = New FileStream("test.txt", FileMode.Open, FileAccess.Read)
ReDim dataSend(myFilestream.Length)
myFilestream.Read(dataSend, 0, myFilestream.Length)
myUdpClient.Send(dataSend, dataSend.Length)
myFilestream.Close()
myUdpClient.Close()
Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub
End Class