System information C# Exercise - C# Programming Course


System information


Create a program that shows specific system details, including the computer name, domain name, and the username of the user who is currently logged in.

 Example Code

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);

Juan A. Ripoll - Programming Tutorials and Courses © 2024 All rights reserved.  Legal Conditions.