| View previous topic :: View next topic |
| Author |
Message |
Ferocious Advanced Cheater
Reputation: 0
Joined: 06 Feb 2008 Posts: 54
|
Posted: Mon Mar 23, 2009 7:33 am Post subject: [C#]Retriving packets in ListView |
|
|
I am using SharpPcap (.NET port of WinPcap) for all my Network analyzing needs.
| Code: | public void device_PcapOnPacketArrival(object sender, Packet packet)
{
if (!backgroundWorker1.IsBusy)
backgroundWorker1.RunWorkerAsync(packet);
}
public void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
Packet packet = e.Argument as Packet;
DateTime time = packet.PcapHeader.Date;
//Retrive packet in ListView
}
|
as the following, device_PcapOnPacketArrival is my packet handler routine, so now, I'm trying to display my packet information in a listview form. _________________
I wanna hack, but I don't know how... |
|
| Back to top |
|
 |
AlbanainRetard Master Cheater
Reputation: 0
Joined: 02 Nov 2008 Posts: 494 Location: Canada eh?
|
Posted: Mon Mar 23, 2009 4:51 pm Post subject: Re: [C#]Retriving packets in ListView |
|
|
| Ferocious wrote: | I am using SharpPcap (.NET port of WinPcap) for all my Network analyzing needs.
| Code: | public void device_PcapOnPacketArrival(object sender, Packet packet)
{
if (!backgroundWorker1.IsBusy)
backgroundWorker1.RunWorkerAsync(packet);
}
public void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
Packet packet = e.Argument as Packet;
DateTime time = packet.PcapHeader.Date;
//Retrive packet in ListView
}
|
as the following, device_PcapOnPacketArrival is my packet handler routine, so now, I'm trying to display my packet information in a listview form. |
listBox1.Add()? _________________
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Tue Mar 24, 2009 8:55 am Post subject: |
|
|
I'm not sure but I think you have to add atleast one colum. (Dependingly on what kind of viewmode you are using, ofc
Listview1.Colums.Add("Your first colum.");
Listview1.Items.Add("A string or ListViewItem To add"); _________________
Intel over amd yes. |
|
| Back to top |
|
 |
Ferocious Advanced Cheater
Reputation: 0
Joined: 06 Feb 2008 Posts: 54
|
Posted: Wed Mar 25, 2009 8:20 am Post subject: |
|
|
thanks to both of you, I've found the main source of the problem, and I've come up with the solution, thanks to good ol' uligor.
Well, the problem was I had my callback function in a saperate thread, so I needed to create a deligate function, thus giving access to that thread to update the main thread, thanks to everyone, for helping. _________________
I wanna hack, but I don't know how... |
|
| Back to top |
|
 |
|