get owner for open port
get owner for open port
get owner for open port
get owner for open port
get owner for open port
get owner for open port get owner for open port get owner for open port get owner for open port get owner for open port get owner for open port get owner for open port get owner for open port
get owner for open port get owner for open port
get owner for open port
Go Back  Xtreme Visual Basic Talk > > > get owner for open port


Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2004, 08:25 PM
justjohnny justjohnny is offline
Newcomer
 
Join Date: Nov 2004
Posts: 2
Default get owner for open port


I'm trying to code a utility which will show the .exe name for any given open port. For instance, if I ask which program or process is using an open ip port, the utility would return the name of the executable or component that's associated with the open port. I want to use IP Helper (iphlpapi.lib) to do this.

MSDN's reference for IP Helper lists a function called "GetOwnerModuleFromTcp6Entry" which is supposed to do this. My problem is that I can't get this function to work in VB.Net. I just don't get it.

Does anyone know how I can implement this in VB.Net? Is there a tutorial out there that explains this in terms of Visual Basic?
Reply With Quote
  #2  
Old 11-12-2004, 09:13 AM
throwaway18 throwaway18 is offline
Contributor
 
Join Date: May 2004
Posts: 504
Default

There is a free program called activeports that does this already.
Reply With Quote
  #3  
Old 11-12-2004, 04:44 PM
justjohnny justjohnny is offline
Newcomer
 
Join Date: Nov 2004
Posts: 2
Default

Quote:
Originally Posted by throwaway18
There is a free program called activeports that does this already.
Thanks. I looked at Active Ports, and that's part of what I want to do with the port owner info. The port owner code I'm trying to achieve is needed for a firewall type of program I'm building.

I order for me to pause, check or block user-chosen apps from accessing a network interface, I would need to identify them in their running process.

Do you know of any code for VB.Net that can catch any given port's owner process, and can render an .exe name or other? IP Helper doesn't have to be the only option. Someone must have written some code with a few API calls or something in VB.Net for this.
Reply With Quote
  #4  
Old 11-27-2004, 12:26 PM
excaliber's Avatar
excaliberget owner for open port excaliber is offline
Senior Contributor

* Expert *
 
Join Date: Nov 2002
Location: Ohio, USA
Posts: 1,828
Default

I don't think .Net can provide this (it is too low level, I believe, but could be very wrong). Instead, you could try to use the WinPCap library in your application. I believe that it has the capability to determine things like that.
__________________
RandomIRC - Your neighborhood's friendly IRC channel (irc.randomirc.com - #code)

"Perl - The only language that looks the same before and after RSA encryption."
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
get owner for open port
get owner for open port
get owner for open port get owner for open port
get owner for open port
get owner for open port
get owner for open port get owner for open port get owner for open port get owner for open port get owner for open port get owner for open port get owner for open port
get owner for open port
get owner for open port
 
get owner for open port
get owner for open port
 
-->