获取系统的当前信息主要使用的"SystemInfomation" 和 "Environment",这里只是拉出来了一些常见的信息,还可以通过其他获取更多的信息,还有兴趣的可以试一下.
我使用的Winform程式测试的,实际上这个写个简单的控制台程序就可以了.
在form上添加一个richTextBox,用于输出获取的信息.
代码都是很简单的,就直接上传代码了,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WinfrmTester
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
richTextBox1.AppendText("计算机名:" &#