Results 1 to 4 of 4

Thread: Name of program using the port

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    97

    Question Name of program using the port

    Heyy all..

    i was wondering...

    when i try to connect using my application (using winsock) through a port which is already engaged to another program on my computer, i get an error message saying "Port already in use" or something like that. Pretty normal.

    Now, if i handle this error...is there any way later on by which i can get the name of the program using this port???

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    97

    Re: Name of program using the port

    any suggestions???

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Name of program using the port

    I know you can get it using Netstat, so there must be some programmatical way of getting it - but I don't know what it is.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Name of program using the port

    What I do is ShellExecute the cmd.exe and pass netstat -ano and a redirect output to a textfile. Then I read it back in as a basic file.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width