🚀 Welcome to Learning System Information with C#! 🚀
This project demonstrates how to retrieve and display system information using C#. By leveraging various system management libraries and APIs, this application can gather details about the operating system, processor, memory, disk drives, and network adapters.
- Operating System Information: Retrieve details such as OS name, version, and manufacturer.
- Processor Information: Get the processor name, manufacturer, and description.
- Memory Information: Display memory capacity and speed.
- Disk Drive Information: Show disk model, interface type, and media type.
- Network Adapter Information: List all network adapters with their name, description, status, and speed.
-
Clone the Repository:
git clone https://github.com/fastuptime/Learning_System_Information_with_C_Sharp.git
-
Open the Project:
- Open the solution file (
.sln
) in Visual Studio.
- Open the solution file (
-
Restore NuGet Packages:
- Ensure you have the
System.Management
package installed via the NuGet Package Manager. - To install manually, use:
Install-Package System.Management
- Ensure you have the
-
Build and Run:
- Build the solution and run the application.
-
Start the Application:
- Run the application from Visual Studio.
-
Get System Information:
- Click the
Get System Information
button. - The system information will be displayed in the rich text box.
- Click the
The core functionality is encapsulated in the Form1
class:
- Event Handling: The
button1_Click
method handles the button click event to initiate the system information retrieval. - Information Retrieval: The
ListSystemInfo
method compiles system information using theGetManagementObject
helper method. - Management Objects: The
GetManagementObject
method uses WMI (Windows Management Instrumentation) to query system properties.
sb.AppendLine("Processor Information:");
sb.AppendLine(GetManagementObject("Win32_Processor", "Name"));
sb.AppendLine(GetManagementObject("Win32_Processor", "Manufacturer"));
sb.AppendLine(GetManagementObject("Win32_Processor", "Description"));
Contributions are welcome! Please fork this repository and submit pull requests.
- Fork the Repository
- Create a Feature Branch:
git checkout -b feature-branch
- Commit Your Changes:
git commit -m 'Add some feature'
- Push to the Branch:
git push origin feature-branch
- Open a Pull Request