惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
GbyAI
GbyAI
S
SegmentFault 最新的问题
量子位
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
J
Java Code Geeks
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
IT之家
IT之家
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
雷峰网
雷峰网

博客园 - <林海>

高效取得图片数据GetImgByte,返回结果数组和像素一一对应 JavaScript中Array 对象相关的几个方法 Javascript总结 sql时间格式转换问题 Transact SQL 常用语句以及函数 C#注册表操作类 Windows API函数大全 windows运行命令详解 Javascript String 对象增强 VS.NET 2003 命名规范 .NET Remoting 实现分布式数据库查询 ASP.NET细节 JS刷新页面问题 javascript 列出本地某个目录下所有的文件 JavaScript每隔一段时间重新加载一下这个JS文件 JavaScript高效地检查每个值是否有重复 Javascript 构造endwith方法 用javascript判断某文件是否存在于本地机器的某路径下 JavaScript语法——style.display 属性
C#读取硬盘序列号
<林海> · 2006-05-19 · via 博客园 - <林海>

using System; using System.IO; using System.Runtime.InteropServices; using System.Text; using Microsoft.Win32; namespace Wjb.ReadOrWriteIniAndReg { ///

/// HardDiskVal 的摘要说明。 /// 读取指定盘符的硬盘序列号 /// 类库开发:吴剑冰 /// 时间:2003年10月20日 /// 功能:读取指定盘符的硬盘序列号 ///

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; string str2 = null; int i = GetVolumeInformation( drvID + @":\", str1, MAX_FILENAME_LEN, ref retVal, a, b, str2, MAX_FILENAME_LEN ); return retVal.ToString(); } public string HDVal() { const int MAX_FILENAME_LEN = 256; int retVal = 0; int a =0; int b =0; string str1 = null; string str2 = null; int i = GetVolumeInformation( "c:\\", str1, MAX_FILENAME_LEN, ref retVal, a, b, str2, MAX_FILENAME_LEN ); return retVal.ToString(); } } }