Tag Archives: system

Display system metric values with descriptions in C#

The example Get system metrics in C# shows how to get system metrics, but the the metrics’ terse names make the results hard to understand. This example displays descriptions of the metrics in addition to their values. Some of the … Continue reading

Posted in API, system | Tagged , , , , , , , , , , , , , , | Leave a comment

Get system metrics in C#

The GetSystemMetrics API function returns system metrics, values that give dimensions used by the system such as the default size of icons and the thickness of a resizable window’s borders. For example, the highlighted line in the picture on the … Continue reading

Posted in API, system | Tagged , , , , , , , , , , , , | 1 Comment

Get a hard drive serial number in C#

The example Get a disk volume serial number in C# shows how you can find the serial number for a disk volume such as C:\. If you reformat or repartition the drive, however, the volume serial number may change. This … Continue reading

Posted in system | Tagged , , , , , , , , , , , | Leave a comment

Get a disk volume serial number in C#

This example uses the GetVolumeInformation API function so get a disk volume’s serial number. It starts by using the System.Rumtime.InteropServices namespace and by declaring the API function. using System.Runtime.InteropServices; … [DllImport(“kernel32.dll”)] private static extern long GetVolumeInformation( string PathName, StringBuilder VolumeNameBuffer, … Continue reading

Posted in system | Tagged , , , , , , , , , , | 2 Comments

Get the computer’s registered owner and organization in C#

In Windows 98, the system’s registered owner and company name is stored in the following Registry keys: SOFTWARE\Microsoft\Windows\CurrentVersion\RegisteredOwner SOFTWARE\Microsoft\Windows\CurrentVersion\RegisteredOrganization In Windows NT and later, the registered owner and company is stored in the following keys: SOFTWARE\Microsoft\Windows NT\CurrentVersion\RegisteredOwner SOFTWARE\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization This … Continue reading

Posted in registry, system | Tagged , , , , , , , , , | Leave a comment

Get the computer’s operating system in C#

This example uses the following code to display the operating system version when it starts. private void Form1_Load(object sender, EventArgs e) { OperatingSystem os_info = System.Environment.OSVersion; lblOs.Text = os_info.VersionString + “\n\nWindows ” + GetOsName(os_info); } This example simply gets the … Continue reading

Posted in system | Tagged , , , , , , , , , | Leave a comment

Write values in the Registry in C#

The example Read Registry values (to get the desktop icon size) in C# shows how to read values from the Registry. This example shows how to write values into the Registry and uses that ability to refresh the desktop icons … Continue reading

Posted in registry, system | Tagged , , , , , , , , , , | Leave a comment

Book Errata Page: The C# Helper Top 100

This is the errata page for my book The C# Helper Top 100, The 100 most popular posts at csharphelper.com. If you find mistakes, please post them here in the Leave a Reply box at the bottom of the page. … Continue reading

Posted in .NET, algorithms, books, C#, C# programming | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments

Book Discussion Page: The C# Helper Top 100

This is a discussion page for my book The C# Helper Top 100, The 100 most popular posts at csharphelper.com. Please post questions, thoughts, and suggestions here in the “Leave a Reply” box at the bottom of the page. I … Continue reading

Posted in .NET, algorithms, books, C#, C# programming | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments

Table of Contents: The C# Helper Top 100

This is a brief summary of the book’s table of contents. Introduction Part I. Serialization 1. Read a CSV File into an Array (1) 2. Use JSON to Serialize and Deserialize Objects (49) Part II. Graphing 3. Draw a Graph … Continue reading

Posted in .NET, algorithms, books, C#, C# programming | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments