Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: .NET
Expertise: Beginner
Oct 24, 2006



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Retrieving PC or System Information

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; 

Jayender Sivaraman
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date