Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. List all the open ports

List all the open ports

Scheduled Pinned Locked Moved C#
questioncsharp
8 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sarang_k
    wrote on last edited by
    #1

    Hi all, I want list out all the open ports for a particular IP Address in c# windows application. How can i do it ? Thanks in advance.

    W E P J 4 Replies Last reply
    0
    • S sarang_k

      Hi all, I want list out all the open ports for a particular IP Address in c# windows application. How can i do it ? Thanks in advance.

      W Offline
      W Offline
      Wayne Gaylard
      wrote on last edited by
      #2

      Have a look at this tip Find an open port on a machine using C#[^]. HTH.

      When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

      P 1 Reply Last reply
      0
      • S sarang_k

        Hi all, I want list out all the open ports for a particular IP Address in c# windows application. How can i do it ? Thanks in advance.

        E Offline
        E Offline
        Ed Hill _5_
        wrote on last edited by
        #3

        You asked this question already, less than a day ago.

        OriginalGriffO 1 Reply Last reply
        0
        • E Ed Hill _5_

          You asked this question already, less than a day ago.

          OriginalGriffO Online
          OriginalGriffO Online
          OriginalGriff
          wrote on last edited by
          #4

          Univote countered

          Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          1 Reply Last reply
          0
          • W Wayne Gaylard

            Have a look at this tip Find an open port on a machine using C#[^]. HTH.

            When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            The problem with that approach is that it only works for the local machine. I believe the OP is looking to scan ports on remote machines.

            *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

            W 1 Reply Last reply
            0
            • S sarang_k

              Hi all, I want list out all the open ports for a particular IP Address in c# windows application. How can i do it ? Thanks in advance.

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              What you are trying to achieve here is a port scanner. This[^] article should give you a decent head start - but there are a couple of things to be aware of. 1. If you are scanning all ports, you should consider running the checks via multiple threads. The reason for this is because checking a port is a time consuming process. 2. Just because the list identifies that a port is free, it doesn't mean that the port will be free when you come to request it. Another application could have taken that port before you get to it, so don't consider that the list is definitive.

              *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

              "Mind bleach! Send me mind bleach!" - Nagy Vilmos

              CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

              1 Reply Last reply
              0
              • P Pete OHanlon

                The problem with that approach is that it only works for the local machine. I believe the OP is looking to scan ports on remote machines.

                *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                W Offline
                W Offline
                Wayne Gaylard
                wrote on last edited by
                #7

                Ahh! Reading the question right is generally a good start :-O

                When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

                1 Reply Last reply
                0
                • S sarang_k

                  Hi all, I want list out all the open ports for a particular IP Address in c# windows application. How can i do it ? Thanks in advance.

                  J Offline
                  J Offline
                  jschell
                  wrote on last edited by
                  #8

                  If you are attempting to create a port scanner then I STRONGLY suggest that you consider the following.... Do not do this unless YOU own the network or you have PERMISSION from the owner of the network in WRITING to do this. People have been expelled from school, lost their network connectivity, been fired from jobs, have had civil judgments rendered against them and even criminally prosecuted because they did this. Even when they thought they had a legitimate need for the functionality.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups