Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C#]Retriving packets in ListView

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Ferocious
Advanced Cheater
Reputation: 0

Joined: 06 Feb 2008
Posts: 54

PostPosted: Mon Mar 23, 2009 7:33 am    Post subject: [C#]Retriving packets in ListView Reply with quote

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
View user's profile Send private message
AlbanainRetard
Master Cheater
Reputation: 0

Joined: 02 Nov 2008
Posts: 494
Location: Canada eh?

PostPosted: Mon Mar 23, 2009 4:51 pm    Post subject: Re: [C#]Retriving packets in ListView Reply with quote

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
View user's profile Send private message Send e-mail
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Tue Mar 24, 2009 8:55 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Ferocious
Advanced Cheater
Reputation: 0

Joined: 06 Feb 2008
Posts: 54

PostPosted: Wed Mar 25, 2009 8:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites