Answer the question
In order to leave comments, you need to log in
What to do with Tcp packet encoding (PacketDotNet)?
I use SharpPcap to capture packets. There is this code:
// Когда приходит пакет, вызывается это событие
private static void Program_OnPacketArrival(object sender, CaptureEventArgs e)
{
Packet packet = Packet.ParsePacket(e.Packet.LinkLayerType, e.Packet.Data);
TcpPacket tcp = (TcpPacket)packet.Extract(typeof(TcpPacket));
if (tcp != null)
{
byte[] data = tcp.PayloadData;
Console.WriteLine(Encoding.UTF8.GetString(data)); // Внимание сюда
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question