CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Location
    Israel
    Posts
    113

    Question In which way to get the host name?

    I need to get the host name of the local PC/Workstation, so I can use the:
    Dns.GetHostName() or Environment.MachineName

    What is the difference between the two? when I read the documentation I couldn't decide which one to use.
    I must say the the PC may not be connected to the Internet/Intranet.

    Which one should I use?
    Is there any other way to get the local host name which is better then the above two?

  2. #2
    Join Date
    Nov 2004
    Location
    Poland
    Posts
    1,355

    Re: In which way to get the host name?

    I think "Environment.MachineName" would be better (if U want netbios name).

    Best regards,
    Krzemo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured