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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. how do you retrieve IP address and host name again?

how do you retrieve IP address and host name again?

Scheduled Pinned Locked Moved C#
question
4 Posts 4 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.
  • R Offline
    R Offline
    ravfingcoder
    wrote on last edited by
    #1

    Hi, how do you retrieve IP address and host name again?

    L 1 Reply Last reply
    0
    • R ravfingcoder

      Hi, how do you retrieve IP address and host name again?

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      ravfingcoder wrote: how do you retrieve IP address and host name again? Like you did the 1st time :) leppie::AllocCPArticle("Zee blog");
      Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.

      D 1 Reply Last reply
      0
      • L leppie

        ravfingcoder wrote: how do you retrieve IP address and host name again? Like you did the 1st time :) leppie::AllocCPArticle("Zee blog");
        Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.

        D Offline
        D Offline
        devvvy
        wrote on last edited by
        #3

        that's how i did it my first time: using System; using System.Net; namespace GetIPAddress { class Class1 { [STAThread] static void Main(string[] args) { IPHostEntry hostInfo = Dns.GetHostByName(""); IPAddress myAddress = hostInfo.AddressList[0]; foreach(IPAddress address in hostInfo.AddressList) { Console.WriteLine("ipaddress: {0}", address.ToString()); } } } } u're welcomed. norm

        Z 1 Reply Last reply
        0
        • D devvvy

          that's how i did it my first time: using System; using System.Net; namespace GetIPAddress { class Class1 { [STAThread] static void Main(string[] args) { IPHostEntry hostInfo = Dns.GetHostByName(""); IPAddress myAddress = hostInfo.AddressList[0]; foreach(IPAddress address in hostInfo.AddressList) { Console.WriteLine("ipaddress: {0}", address.ToString()); } } } } u're welcomed. norm

          Z Offline
          Z Offline
          zhouao
          wrote on last edited by
          #4

          using System; using System.Net; class getip { public static void Main(string[] args) { IPHostEntry hostInfo = Dns.GetHostByName("host"); IPAddress myAddress = hostInfo.AddressList[0]; Console.WriteLine("ipaddress: {0}",myAddress.ToString()); }}

          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