日期:2014-05-17 浏览次数:20458 次
//获取ip mac地址
public static string GetMacAddress()
{
ManagementClass class2 = new ManagementClass("Win32_NetworkAdapterConfiguration");
foreach (ManagementObject obj2 in class2.GetInstances())
{
if (obj2["IPEnabled"].ToString() == "True")
{
return obj2["MacAddress"].ToString();
}
}
return null;
}
//获取硬盘序列号
public static string GetHardDiskSN()
{
return GetHardwareInfo(HardwareEnum.Win32_PhysicalMedia, "SerialNumber");
}
using System;
using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
using System.Web;
using System.Xml;
using Galsun.Common;
using Galsun.HH.FCX.Content;
using Galsun.HH.FCX.Mode;
using System.Data;
using System.Management;
namespace Galsun.HH.FCX.Web.UI
{
public class HttpModule : System.Web.IHttpModule
{
/// <summary>
/// 实现接口的Init方法
/// </summary>
/// <param name="context"></param>
public void Init(HttpApplication context)
{
Hard hard = Hard.GetCacheService();
GetHardID();
}
/// <summary>
/// 获取硬盘ID
/// </summary>
/// <returns>硬盘ID</ret