• 通过WMI获取主板信息


    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Management;

    namespace CS
    {
        class Program
        {
            static void Main(string[] args)
            {
                PrintMotherBoardInfo();
                Console.WriteLine(GetMotherBoardSerialNumber());
            }

            /// <summary>
            /// 打印主板信息
            /// </summary>
            private static void PrintMotherBoardInfo()
            {
                ManagementClass mc = new ManagementClass("WIN32_BaseBoard");
                ManagementObjectCollection moc = mc.GetInstances();
                foreach (ManagementObject mo in moc)
                {
                    foreach (PropertyData pd in mo.Properties)
                    {
                        Console.WriteLine(string.Format("{0}{1}{2}",pd.Name,"\t", pd.Value));
                    }
                }
            }

            //获取主板序号
            private static string GetMotherBoardSerialNumber()
            {
                ManagementClass mc = new ManagementClass("WIN32_BaseBoard");
                ManagementObjectCollection moc = mc.GetInstances();
                string SerialNumber = "";
                foreach (ManagementObject mo in moc)
                {
                    SerialNumber= mo["SerialNumber"].ToString();
                    break;
                }
                return SerialNumber;
            }
        }
    }

     
  • 相关阅读:
    抽象
    数据处理—异常值处理
    数据处理—数据连续属性离散化
    数据处理—缺失值处理
    数据处理—归一化
    数据特征—正态性检验
    数据特征—相关性分析
    数据分析—统计分析
    数据特征—帕累托分析
    特征分析—对比分析
  • 原文地址:https://www.cnblogs.com/liufei88866/p/1732711.html
Copyright © 2020-2023  润新知