All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
技巧:PHP的优化,缓冲,压缩实际的解决方案_php资料_编程技术
C#教程:注册COM+服务组件应用实例
ADO.NET概述
Windows,Server,2003,安全配置实战演习_[SQL,Server教程]
使用ASP.NET,AJAX框架扩展HTML,Map控件_[Asp.Net教程]
网页制作兼容Mozilla必须知道的知识_JavaScript技术_编程技术
ajax+php无刷新二级联动下拉菜单
asp.net2.0推荐一个功能强大的图片选择控件_[Asp.Net教程]
php程序如何生成验证码图片_php资料_编程技术
asp.net中客户端怎么保持与服务器时间一致_[Asp.Net教程]
Reading number is top 10 pictures
Absolutely shocked. National geographic 50 animal photographys2
A man's favorite things3--ZhouWeiTong
真正的国产-非模拍 贵在是真实1
含苞欲放的素颜美少女2
Distribution of wealth in China survey status report
看到这个手速,决定过年就让我家猫帮我抢红包了。。
Nikon microscopic photography of the first three
The other a successor of sora aoi
2012 national geographic daily picture4
全球十大灵异酒店
Download software ranking
matrix3
变速齿轮3.26
Eclipse 4.2.2 For Win32
美女写真2
打鸟视频
Unix video tutorial9
I for your crazy
金山office2007
asp.net技术内幕
JSP+Ajax Web development typical examples
delv published in(发表于) 2014/1/6 9:06:40 Edit(编辑)
C#应用:读取指定盘符的硬盘序列号_[Asp.Net教程]

C#应用:读取指定盘符的硬盘序列号_[Asp.Net教程]

C#应用:读取指定盘符的硬盘序列号_[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;
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();
}
}


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.