Programming Course in C# ¡Free!

12.08 - System information

 Saturday, April 06, 2013 published by Exercises C#
Create a program that shows certain details of the system: computer name, domain name and user name logged in the system. 


Machine name: <machinename>

Domain name: <domainname>
User name: <username>

using System;

class SystemInformation
    static void Main(string[] args)
        string machineName = Environment.MachineName;
        string domainName = Environment.UserDomainName;
        string userName = Environment.UserName;

        Console.WriteLine("Machine name: {0}", machineName);
        Console.WriteLine("Domain name: {0}", domainName);
        Console.WriteLine("User name: {0}", userName);