用C#编程怎么样实现提取原始的物理MAC地址(不是更改过的MAC地址)
目前提取MAC地址的方法超级多,但是提取原始mac地址的方法,确非常少,mac地址更改过后,提取的居然是改过的mac地址,原始的mac地址不知用什么方法能够实现提取
目前提取MAC地址的方法超级多,但是提取原始mac地址的方法,确非常少,mac地址更改过后,提取的居然是改过的mac地址,原始的mac地址不知用什么方法能够实现提取
答案:测试源代码using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Management;
using System.DirectoryServices;
using System.Net;
using System.Net.Sockets;
namespace MAC_IP_Computer_name{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtMac;
private System.Windows.Forms.TextBox txtIP;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.Button btnGet;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.TextBox txtCPUInfo;
private System.Windows.Forms.Label label4;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txtMac = new System.Windows.Forms.TextBox();
this.txtIP = new System.Windows.Forms.TextBox();
this.txtName = new System.Windows.Forms.TextBox();
this.btnGet = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.txtCPUInfo = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.F