我爱Aspx >> Asp.Net >> 读取指定盘符的硬盘序列号using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Win32;
namespace Wjb.ReadOrWriteIniAndReg
{
/**////
/// 读取指定盘符的硬盘序列号
///
public class HardDiskVal
{
[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
);
/**////
/// 获得盘符为drvID的硬盘序列号,缺省为C
///
///
///
public string HDVal(string drvID)
{
const int MAX_FILENAME_LEN = 256;
int retVal = 0;
int a =0;
int b =0;
string str1 = null;
Ҷƪл˵?
获取cpu序列号,硬盘ID,网卡MAC地..[08-01]
建立一个传表名参数的存储过程[08-01]
[视频]Discuz!安装系列:Discuz!..[08-01]
Photoshop快速打造iPod美女海报[08-01]
WPS2005中页眉页脚的设计技巧[08-01]
PQ分区出错,用Ghost来补救的绝妙..[08-01]
CorelDraw绘制06德国世界杯Logo图..[08-01]
用Dreamweaver 8 搞定“web标准”[08-01]
漫谈Ajax在.Net中的使用[08-01]
將datagrid控件內容輸出到excel文..[08-01]