To retrieve PC or System information (things like the operating system, domain name, logical drives, IP address, or environment variables), use the
System class and the
Environment class.
List of name space used in the project
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using Microsoft.Win32;
using System.Collections;
private void Form1_Load(object sender, EventArgs e)
{
// There are about 5 labels in the form
label1.Text = Environment.SystemDirectory;
label2.Text = Environment.MachineName;
label3.Text = Environment.CurrentDirectory;
label5.Text = Environment.OSVersion.ToString();
IDictionary environmentVariables = Environment.GetEnvironmentVariables();
string str2 = "";
string str3 = "";
foreach (DictionaryEntry de in environmentVariables)
{
str2 = de.Key.ToString();
str3 = str3 + str2 + " , ";
}
label5.Text = str3;
}