title: C# SharpPCap Read Packet Content
body: <p>i'm tryin' to read the content of the packets that i've captured with SharpPCap. 
  This is my little code</p>
  
  <pre><code>private void button4_Click(object sender, EventArgs e)
          {
              // Retrieve the device list
              var devices = LibPcapLiveDeviceList.Instance;
  
              // Extract a device from the list
              var device = devices[1];
  
              // Register our handler function to the
              // 'packet arrival' event
              device.OnPacketArrival +=
                  new SharpPcap.PacketArrivalEventHandler(device_OnPacketArrival);
  
              // Open the device for capturing
              int readTimeoutMilliseconds = 1000;
              if (device is AirPcapDevice)
              {
                  // NOTE: AirPcap devices cannot disable local capture
                  var airPcap = device as AirPcapDevice;
                  airPcap.Open(SharpPcap.WinPcap.OpenFlags.DataTransferUdp, readTimeoutMilliseconds);
              }
              else if (device is WinPcapDevice)
              {
                  var winPcap = device as WinPcapDevice;
                  winPcap.Open(SharpPcap.WinPcap.OpenFlags.DataTransferUdp | SharpPcap.WinPcap.OpenFlags.NoCaptureLocal, readTimeoutMilliseconds);
              }
              else if (device is LibPcapLiveDevice)
              {
                  var livePcapDevice = device as LibPcapLiveDevice;
                  livePcapDevice.Open(DeviceMode.Promiscuous, readTimeoutMilliseconds);
              }
              else
              {
                  throw new System.InvalidOperationException("unknown device type of " + device.GetType().ToString());
              }
  
              device.Open(DeviceMode.Promiscuous, readTimeoutMilliseconds);
  
              device.StartCapture();
  
              MessageBox.Show("-- Listening on {0}, hit 'Enter' to stop...",
                  device.Description);
  
              // Stop the capturing process
              device.StopCapture();
  
              // Close the pcap device
              device.Close();
  
          }
  
  private static void device_OnPacketArrival(object sender, CaptureEventArgs e)
          {
              if (e.Packet.LinkLayerType == PacketDotNet.LinkLayers.Ethernet)
              {
                  var packet = PacketDotNet.Packet.ParsePacket(e.Packet.LinkLayerType, e.Packet.Data);
                  var ethernetPacket = (PacketDotNet.EthernetPacket)packet;
  
                  MessageBox.Show(System.Text.Encoding.ASCII.GetString(e.Packet.Data));
                  packetIndex++;
              }
          }
  </code></pre>
  
  <p>I capture a byte[] packet but i don't know how can i read the whole server response.
  thank you for the help</p>