CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    57

    How to get Domain Name ?

    How do I retrieve the Name of a domain on which my machine is running ( like .microsoft.com) ?


    M.Anand
    Development - Lead ,
    Satyam Infoway Limited,
    Chennai - 600034
    India

  2. #2
    Join Date
    May 1999
    Posts
    2

    Re: How to get Domain Name ?

    Is it right?


    char lpBuffer[50];
    GetEnvironmentVariable("userdomain",lpBuffer,50);
    printf(lpBuffer);


  3. #3
    Join Date
    Apr 1999
    Posts
    57

    Re: How to get Domain Name ?

    Hi

    Thanks for your response but I think "userdomain" is a crucial parameter. I know my Machine Name and nothing else. I got the solution anyway. I used gethostbyName which returns HOSTENT structure which has the Domain details

    Anand

    M.Anand
    Development - Lead ,
    Satyam Infoway Limited,
    Chennai - 600034
    India

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