日期:2014-05-17 浏览次数:20466 次
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
using System.Management;
using System.Diagnostics;
namespace Galsun.HH.FCX.Content
{
/// <summary>
/// 获取硬件信息
/// </summary>
public class Hard
{
private static volatile Hard instance = null;
private static object lockHelper = new object();
private string _HardID = string.Empty;
/// <summary>
/// 构造函数
/// </summary>
private Hard()
{
_HardID = GetHardInfo();
}
/// <summary>
/// 获取硬件信息
/// </summary>
public string HardID
{
get
{
return _HardID;
}
}
/// <summary>
/// 单体模式返回当前类的实例
/// </summary>
/// <returns></returns>
public static Hard GetCacheService()
{
if (instance == null)
{
lock (lockHelper)
{
if (instance == null)
{
instance = new Hard();
}
&