这是发送端程序:
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDPClient
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
private static IPAddress GroupAddress = 
IPAddress.Parse("210.46.78.88");
private static int GroupPort = 11000; /// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
Send();
            Console.Read (); } private static void Send( ) 
{
UdpClient sender = new UdpClient();
IPEndPoint groupEP = new IPEndPoint(GroupAddress,GroupPort); try 
{
Console.WriteLine ("input you message!");
string message = Console.ReadLine ();
Console.WriteLine("*******Sending datagram : {0}******", message);
byte[] bytes = Encoding.ASCII.GetBytes(message); sender.Send(bytes, bytes.Length, groupEP);
      
sender.Close();
      

catch (Exception e) 
{
Console.WriteLine(e.ToString());
}
    
} }
}大家运行一下试试