Invio pacchetti udp

mercoledì 15 novembre 2006 - 20.10

bluland Profilo | Guru

salve,
mi servirebbe costruire una apply che mi consenta di inviare pacchetti udp, ovviamente uso vs 2003 e non ho molta dimestichezza con le win apply, qualcuno puo' aiutarmi??

saluti


--------------------
Vincenzo PESANTE

0v3rCl0ck Profilo | Guru

Ciao,

eccoti un semplice esempio per spedire e ricevere pacchetti udp:

Dim ObjUdpClient As New System.Net.Sockets.UdpClient ObjUdpClient.Connect("192.168.0.2", 666) Dim SendBytes As Byte() = System.Text.Encoding.ASCII.GetBytes("c'e' qualcuno?") ObjUdpClient.Send(SendBytes, SendBytes.Length) Dim RemoteIpEndPoint As New System.Net.IPEndPoint(System.Net.IPAddress.Any, 0) Dim ReceiveBytes As Byte() = ObjUdpClient.Receive(RemoteIpEndPoint) Dim ReturnData As String = System.Text.Encoding.ASCII.GetString(ReceiveBytes) ObjUdpClient.Close() MessageBox.Show(ReturnData)


Enjoy It
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5