tags:

views:

93

answers:

3

how we can find the application program if we know port number and ip address in visual studio

A: 

IF it's a program you're looking for TCPView from Mark Russinovich

Indeera
+1  A: 

the easiest way is to run the following command and parse the output, then get PID with the specified port number

"netstat -n -b"

sample output

Proto Local Address Foreign Address State PID

TCP 192.168.0.31:1220 192.168.0.27:445 ESTABLISHED 4 [System]

TCP 192.168.1.91:3866 192.168.1.80:3389 ESTABLISHED 61508 [mstsc.exe]

TCP 192.168.0.31:4065 192.168.0.25:80 ESTABLISHED 528 [Smc.exe]

TCP 192.168.0.31:1838 74.125.39.91:80 CLOSE_WAIT 3260 [GoogleQuickSearchBox.exe]

TCP 127.0.0.1:1124 127.0.0.1:4066 TIME_WAIT 0 TCP 192.168.0.31:4071 72.233.69.5:80 TIME_WAIT 0 TCP 192.168.0.31:4072 72.233.69.5:80 TIME_WAIT 0

Ahmed Said
+1, I forgot about netstat :)
Indeera
A: 

is there any function which i can use in my c++ code to get that ........

rajnesh