System.ManageMent
试试看了。

解决方案 »

  1.   

    public class PacketArrivedEventArgs : EventArgs 
    {
    public PacketArrivedEventArgs() 
    {
    this.protocol = "";
    this.destination_port  = "";
    this.origination_port  = "";
    this.destination_address  = "";
    this.origination_address  = "";
    this.ip_version  = ""; this.total_packet_length =0;
    this.message_length =0;
    this.header_length =0; this.receive_buf_bytes=new byte[len_receive_buf];
    this.ip_header_bytes=new byte[len_receive_buf];
    this.message_bytes=new byte[len_receive_buf];
    } public string Protocol
    {
    get {return protocol;}
    set {protocol=value;}
    }
    public string DestinationPort
    {
    get {return destination_port;}
    set {destination_port=value;}
    }
    public string OriginationPort
    {
    get {return origination_port;}
    set {origination_port=value;}
    }
    public string DestinationAddress
    {
    get {return destination_address;}
    set {destination_address=value;}
    }
    public string OriginationAddress
    {
    get {return origination_address;}
    set {origination_address=value;}
    }
    public string IPVersion
    {
    get {return ip_version;}
    set {ip_version=value;}
    }
    public uint PacketLength
    {
    get {return total_packet_length;}
    set {total_packet_length=value;}
    }
    public uint MessageLength
    {
    get {return message_length;}
    set {message_length=value;}
    }
    public uint HeaderLength
    {
    get {return header_length;}
    set {header_length=value;}
    }
    public byte [] ReceiveBuffer
    {
    get {return receive_buf_bytes;}
    set {receive_buf_bytes=value;}
    }
    public byte [] IPHeaderBuffer
    {
    get {return ip_header_bytes;}
    set {ip_header_bytes=value;}
    }
    public byte [] MessageBuffer
    {
    get {return message_bytes;}
    set {message_bytes=value;}
    }
    private string protocol;
    private string destination_port;
    private string origination_port;
    private string destination_address;
    private string origination_address;
    private string ip_version;
    private uint total_packet_length;
    private uint message_length;
    private uint header_length;
    private byte []receive_buf_bytes = null;
    private byte []ip_header_bytes = null;
    private byte []message_bytes = null;
    }
      

  2.   

    http://www.thecodeproject.com/csharp/networkmonitor.asp?df=100&forumid=3648&exp=0&select=859223下载代码,你看的哪儿的文章?估计又是一个文抄公。