PC_Info/WindowsFormsApplication1/Backup/Form1.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Management; //需要在解决方案中引用System.Management.DLL文件
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
HardInfoClass myclass = new HardInfoClass();
textBox1.Text = myclass.GetHardDiskID();
textBox2.Text = myclass.GetCpuID();
textBox3.Text = myclass.GetNetCardMAC();
textBox4.Text = myclass.GetNetCardIP();
textBox5.Text = myclass.GetHostName();
textBox6.Text = myclass.GetVolOf("D");//C盘58c6b679跟D盘6ed62864不一样
}
}
//
/// <summary>
/// HardInfoClass 的摘要说明。
/// </summary>
public class HardInfoClass
{
[DllImport("kernel32.dll")]
private static extern int GetVolumeInformation(
string lpRootPathName,
string lpVolumeNameBuffer,
int nVolumeNameSize,
ref int lpVolumeSerialNumber,
int lpMaximumComponentLength,
int lpFileSystemFlags,
string lpFileSystemNameBuffer,
int nFileSystemNameSize
);
public HardInfoClass()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
//获取机器名
后面还有 126 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
