Connecting Tech Pros Worldwide Forums | Help | Site Map

get application name by port

Member
 
Join Date: Apr 2009
Posts: 44
#1: Sep 29 '09
okay so i made this application, it monitors all the internet activity of internet, with protocols, so i get information about every packet being sent on internet, including destination and source, but i dont know how to get process name, when i run it shows a like a spam of packets being sent but cant recognize what application/process is sending em, so i want some way to get process of the packet sent.. any confusions?

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: Sep 29 '09

re: get application name by port


The output of netstat -no contains the ProcessID numbers for the port.
You could parse that?
There is bound to be a better way though.

Also maybe from here:
http://www.codeproject.com/KB/IP/iphlpapi.aspx
Member
 
Join Date: Apr 2009
Posts: 44
#3: Sep 30 '09

re: get application name by port


sorry but i didn't did it the way shown in code project, i attached the 2 .cs which i use to get packets
Attached Files
File Type: zip PacketMonitor.zip (5.3 KB, 2 views)
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#4: Sep 30 '09

re: get application name by port


It doesn;'t matter how you get the packets, its how you go from ports->application name that you should be taking from those examples
Member
 
Join Date: Apr 2009
Posts: 44
#5: Sep 30 '09

re: get application name by port


i cant understand the examples...
Reply