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. Find Internet Server IP address

Find Internet Server IP address

Scheduled Pinned Locked Moved C#
csharpphpsysadmintutorial
11 Posts 5 Posters 3 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.
  • V vasanth arivali

    I could not find the ip address of my internet server. i used the code to find the server ip but it only fetch my local LAN ip address. i want to know the IP that given by my ISP through C# Windows Application code. or And i use web browser control, how to find the IP address of the URL. Because by using PHP i get the IP using RemoteObject with the browser URL. how i got that same by using that control in C# Windows Application. by Vasanth.A

    OriginalGriffO Offline
    OriginalGriffO Offline
    OriginalGriff
    wrote on last edited by
    #2

    In order to get the out-side-world IP address, you have to talk to the outside world as it is shared between the various users on the LAN. Google for "whats my IP" and you will get lots of hits about it.

    No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

    "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
    • V vasanth arivali

      I could not find the ip address of my internet server. i used the code to find the server ip but it only fetch my local LAN ip address. i want to know the IP that given by my ISP through C# Windows Application code. or And i use web browser control, how to find the IP address of the URL. Because by using PHP i get the IP using RemoteObject with the browser URL. how i got that same by using that control in C# Windows Application. by Vasanth.A

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #3

      Hi, The solution requires the help from a web server. This[^] should help you out. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


      V 1 Reply Last reply
      0
      • V vasanth arivali

        I could not find the ip address of my internet server. i used the code to find the server ip but it only fetch my local LAN ip address. i want to know the IP that given by my ISP through C# Windows Application code. or And i use web browser control, how to find the IP address of the URL. Because by using PHP i get the IP using RemoteObject with the browser URL. how i got that same by using that control in C# Windows Application. by Vasanth.A

        M Offline
        M Offline
        Mirko1980
        wrote on last edited by
        #4

        You can get the ip address(es) from an host name with the following code: System.Net.Dns.GetHostEntry(hostname).AddressList; This method will retrieve all the ip addresses corresponding to a given host, documentation here. For example, if hostname is "www.google.com" you will get:

        {System.Net.IPAddress[6]}
        [0]: {74.125.39.105}
        [1]: {74.125.39.106}
        [2]: {74.125.39.103}
        [3]: {74.125.39.104}
        [4]: {74.125.39.99}
        [5]: {74.125.39.147}

        L 1 Reply Last reply
        0
        • L Luc Pattyn

          Hi, The solution requires the help from a web server. This[^] should help you out. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


          V Offline
          V Offline
          vasanth arivali
          wrote on last edited by
          #5

          thank you, but i want to find through C# code give me exameple

          1 Reply Last reply
          0
          • M Mirko1980

            You can get the ip address(es) from an host name with the following code: System.Net.Dns.GetHostEntry(hostname).AddressList; This method will retrieve all the ip addresses corresponding to a given host, documentation here. For example, if hostname is "www.google.com" you will get:

            {System.Net.IPAddress[6]}
            [0]: {74.125.39.105}
            [1]: {74.125.39.106}
            [2]: {74.125.39.103}
            [3]: {74.125.39.104}
            [4]: {74.125.39.99}
            [5]: {74.125.39.147}

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #6

            Except that if you use it on yourself, you will get your LAN address.

            M 1 Reply Last reply
            0
            • V vasanth arivali

              I could not find the ip address of my internet server. i used the code to find the server ip but it only fetch my local LAN ip address. i want to know the IP that given by my ISP through C# Windows Application code. or And i use web browser control, how to find the IP address of the URL. Because by using PHP i get the IP using RemoteObject with the browser URL. how i got that same by using that control in C# Windows Application. by Vasanth.A

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #7

              Hi, normally I wouldn't recommend it, but please check my article - it gives you the information you need to get your public IP address with C# (and just C#) without cheats (not using external websites that may disappear at any moment) The second thing, I don't know.

              1 Reply Last reply
              0
              • L Lost User

                Except that if you use it on yourself, you will get your LAN address.

                M Offline
                M Offline
                Mirko1980
                wrote on last edited by
                #8

                Well, if he passes the external dns address of the server, I think he will get the external ip address, or am I wrong?

                L 1 Reply Last reply
                0
                • M Mirko1980

                  Well, if he passes the external dns address of the server, I think he will get the external ip address, or am I wrong?

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #9

                  Only if he can get the external dns address in the first place, which might not even exist Btw, I didn't 1-vote you, it didn't seem that bad - just "not exactly what he asked for", his question sortof half implies that it's all a local thing

                  M 1 Reply Last reply
                  0
                  • L Lost User

                    Only if he can get the external dns address in the first place, which might not even exist Btw, I didn't 1-vote you, it didn't seem that bad - just "not exactly what he asked for", his question sortof half implies that it's all a local thing

                    M Offline
                    M Offline
                    Mirko1980
                    wrote on last edited by
                    #10

                    No problem, I was not arguing with you, only clarifying what I had in mind while answering to the OP. I was more concentrated on his second question (getting the IP address from the browser url) that might imply he knows the external address.

                    L 1 Reply Last reply
                    0
                    • M Mirko1980

                      No problem, I was not arguing with you, only clarifying what I had in mind while answering to the OP. I was more concentrated on his second question (getting the IP address from the browser url) that might imply he knows the external address.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #11

                      Hm yea, you got a point Well he's not saying anything yet, but I guess we'll find out :)

                      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