Get the network domain name associated with the current user in CSharp

Description

The following code shows how to get the network domain name associated with the current user.

Example


//from w w w . ja  v a2s  .c om
using System;

class Sample 
{
    public static void Main() 
    {
        Console.WriteLine(Environment.UserDomainName);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Development »




Console
Encoding
Environment
Random