I get this simple code on button click event: Code: Dim udpClient As New UdpClient Dim buf(101) As Char Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(buf) For x As Integer = 0 To 5 sendBytes(x) = CInt("&HFF") Next Dim MacAddress As String MacAddress = "00AB221F4E5A" Dim i As Integer = 6 For x As Integer = 1 To 16 sendBytes(i) = CInt("&H" + MacAddress.Substring(0, 2)) sendBytes(i + 1) = CInt("&H" + MacAddress.Substring(2, 2)) sendBytes(i + 2) = CInt("&H" + MacAddress.Substring(4, 2)) sendBytes(i + 3) = CInt("&H" + MacAddress.Substring(6, 2)) sendBytes(i + 4) = CInt("&H" + MacAddress.Substring(8, 2)) sendBytes(i + 5) = CInt("&H" + MacAddress.Substring(10, 2)) i += 6 Next Dim myAddress As String = "www.someDomainHere.com" Try udpClient.Send(sendBytes, sendBytes.Length, myAddress, 9) Label1.Text = "Succes!" Catch ex As Exception Label1.Text = " Error:" & ex.Message End Try i always get this error: Error:Request for the permission of type 'System.Net.SocketPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. I need to change something on control panel for change properly permissions or its impossible to send UDP Packet from Winhost hosted page? Thx in advance.
Try increasing the trust level of your web application. http://support.Winhost.com/KB/a657/changing-the-default-aspnet-trust-level.aspx