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. C# Host with IP address detect!

C# Host with IP address detect!

Scheduled Pinned Locked Moved C#
csharp
6 Posts 2 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.
  • N Offline
    N Offline
    nhqlbaislwfiikqraqnm
    wrote on last edited by
    #1

    Hey guys! This is a code for that! http://dotnet-snippets.de/dns/host-via-ip-adresse-ermitteln-SID977.aspx[^] I want to read the Ip from a TextBox out and then he should show me the hostname in a other textbox. And i don´t know what code i should add!

    R N 2 Replies Last reply
    0
    • N nhqlbaislwfiikqraqnm

      Hey guys! This is a code for that! http://dotnet-snippets.de/dns/host-via-ip-adresse-ermitteln-SID977.aspx[^] I want to read the Ip from a TextBox out and then he should show me the hostname in a other textbox. And i don´t know what code i should add!

      R Offline
      R Offline
      ricmil42
      wrote on last edited by
      #2

      If you just want to call that method from your code, try this.

      targetTextBox.Text = GetHostNameByIp ( sourceTextBox.Text ) ;

      N 1 Reply Last reply
      0
      • R ricmil42

        If you just want to call that method from your code, try this.

        targetTextBox.Text = GetHostNameByIp ( sourceTextBox.Text ) ;

        N Offline
        N Offline
        nhqlbaislwfiikqraqnm
        wrote on last edited by
        #3

        Ok! It´s a code to show me the Host from a Ip and he must get the ip from where! And how can i add a code to read the Ip from a textbox out? then the host name should he show me in another textbox or in the same

        R 1 Reply Last reply
        0
        • N nhqlbaislwfiikqraqnm

          Ok! It´s a code to show me the Host from a Ip and he must get the ip from where! And how can i add a code to read the Ip from a textbox out? then the host name should he show me in another textbox or in the same

          R Offline
          R Offline
          ricmil42
          wrote on last edited by
          #4

          The code in the example I gave you should be what you need.

          targetTextBox.Text = GetHostNameByIp ( sourceTextBox.Text ) ;

          Or try this.

          string ipAddress = sourceTextBox.Text ; // This is the text box holding the IP Address.
          string hostName = GetHostNameByIp ( ipAddress ) ; // Get the Hostname.
          targetTextBox.Text = hostName ; // Put the Hostname in the other text box.

          This is the same as the single-line example.

          1 Reply Last reply
          0
          • N nhqlbaislwfiikqraqnm

            Hey guys! This is a code for that! http://dotnet-snippets.de/dns/host-via-ip-adresse-ermitteln-SID977.aspx[^] I want to read the Ip from a TextBox out and then he should show me the hostname in a other textbox. And i don´t know what code i should add!

            N Offline
            N Offline
            nhqlbaislwfiikqraqnm
            wrote on last edited by
            #5

            i have the solution!

            N 1 Reply Last reply
            0
            • N nhqlbaislwfiikqraqnm

              i have the solution!

              N Offline
              N Offline
              nhqlbaislwfiikqraqnm
              wrote on last edited by
              #6

              thank you for help :thumbsup:

              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