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. How to learn machine name and username by using IP adress

How to learn machine name and username by using IP adress

Scheduled Pinned Locked Moved C#
questionhelptutorial
13 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.
  • S Sokka93

    I don't know first I used my real name then I decided not to use my real name. Thanks for the answer :)

    S Offline
    S Offline
    Sokka93
    wrote on last edited by
    #4

    I have to go I have a roll call.

    1 Reply Last reply
    0
    • S Sokka93

      How can I learn a computer's machine name and user name by using IP adress? Can you help me please? Thanks in advance.

      J Offline
      J Offline
      Jimmanuel
      wrote on last edited by
      #5

      you can lookup the host name of a computer on a network like this:

      System.Net.Dns.GetHostEntry("127.0.0.1").HostName

      D 1 Reply Last reply
      0
      • J Jimmanuel

        you can lookup the host name of a computer on a network like this:

        System.Net.Dns.GetHostEntry("127.0.0.1").HostName

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #6

        That will give you the DNS hostname, not necessarily the Windows Computer Name.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        J 1 Reply Last reply
        0
        • D Dave Kreskowiak

          That will give you the DNS hostname, not necessarily the Windows Computer Name.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          J Offline
          J Offline
          Jimmanuel
          wrote on last edited by
          #7

          ok, hopefully that's better than nothing :)

          D 1 Reply Last reply
          0
          • J Jimmanuel

            ok, hopefully that's better than nothing :)

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #8

            I just hope the OP knows the difference. :-D

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            S 1 Reply Last reply
            0
            • D Dave Kreskowiak

              I just hope the OP knows the difference. :-D

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              S Offline
              S Offline
              Sokka93
              wrote on last edited by
              #9

              The code works for my computer's IP address but when I try an another IP address it gives the IP address of the target computer.

              S 1 Reply Last reply
              0
              • S Sokka93

                The code works for my computer's IP address but when I try an another IP address it gives the IP address of the target computer.

                S Offline
                S Offline
                Sokka93
                wrote on last edited by
                #10

                Here is the code It works. :D Thank you.

                System.Net.Dns.GetHostByAddress(IPaddress).HostName.ToString();

                S 1 Reply Last reply
                0
                • S Sokka93

                  Here is the code It works. :D Thank you.

                  System.Net.Dns.GetHostByAddress(IPaddress).HostName.ToString();

                  S Offline
                  S Offline
                  Sokka93
                  wrote on last edited by
                  #11

                  But I have an another problem. I can't send ping every computers. Can you help me with it?

                  D 1 Reply Last reply
                  0
                  • S Sokka93

                    But I have an another problem. I can't send ping every computers. Can you help me with it?

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #12

                    My.Computer.Network.Ping[^]. BTW, pinging a machine only tells you in the network stack of the target computer is working, up to a certain point, and that's only IF it doesn't have a firewall blocking ICMP traffic. It will NOT tell you if the target server you're trying to connect to is actually listening.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008

                    S 1 Reply Last reply
                    0
                    • D Dave Kreskowiak

                      My.Computer.Network.Ping[^]. BTW, pinging a machine only tells you in the network stack of the target computer is working, up to a certain point, and that's only IF it doesn't have a firewall blocking ICMP traffic. It will NOT tell you if the target server you're trying to connect to is actually listening.

                      A guide to posting questions on CodeProject[^]
                      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                           2006, 2007, 2008

                      S Offline
                      S Offline
                      Sokka93
                      wrote on last edited by
                      #13

                      Thank uou very much.

                      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