cad2008序列号怎么弄弄

当前位置: →
→ 如何获得硬盘序列号
如何获得硬盘序列号
& 作者及来源: Virus-BeautyCode - 博客园 &
&收藏到→_→:
摘要: 如何获得硬盘序列号
"如何获得硬盘序列号"::
本文是我摘抄网上的东西,谢谢硬盘序列号(serial number)不等于卷标号(volume name),后者虽然很容易得到,但是化分区后就会重写,不可靠。遗憾的是很多朋友往往分不清这一点。
要得到硬盘的物理序列号,可以通过wmi,也就是win32_physicalmedia.serialnumber。可惜的是windows 98/me的wmi并不支持这个类,访问时会出现异常。
受陆麟的例子的启发,我们还可以通过s.m.a.r.t.接口,直接从ring3调用api
deviceiocontrol()来获取硬盘信息,而不需要写vxd或者driver。这样这个问题就解决了,我对它进行了封装,大量使用了
p/invoke技术,一个完整的library。支持windows 98-2003。
使用上很简单:
harddiskinfo hdd = atapidevice.gethddinfo(0); // 第一个硬盘
console.writeline("module number: {0}", hdd.modulenumber);
console.writeline("serial number: {0}", hdd.serialnumber);
console.writeline("firmware: {0}", hdd.firmware);
console.writeline("capacity: {0} m", hdd.capacity);
下面是全部代码:
using&using&system.runtime.using&system.namespace&sunmast.hardware{[serializable]public&struct&harddiskinfo{/**////&&summary&///&型号///&&/summary&public&string&/**////&&summary&///&固件版本///&&/summary&public&string&/**////&&summary&///&序列号///&&/summary&public&string&/**////&&summary&///&容量,以m为单位///&&/summary&public&uint&}internal&structs#region&internal&structs[structlayout(layoutkind.sequential,&pack=1)]internal&struct&getversionoutparams{public&byte&public&byte&public&byte&public&byte&public&uint&[marshalas(unmanagedtype.byvalarray,&sizeconst=4)]public&uint[]&&//&for&future&use.}[structlayout(layoutkind.sequential,&pack=1)]internal&struct&ideregs{public&byte&public&byte&public&byte&public&byte&public&byte&public&byte&public&byte&public&byte&}[structlayout(layoutkind.sequential,&pack=1)]internal&struct&sendcmdinparams{public&uint&public&ideregs&public&byte&[marshalas(unmanagedtype.byvalarray,&sizeconst=3)]public&byte[]&[marshalas(unmanagedtype.byvalarray,&sizeconst=4)]public&uint[]&public&byte&}[structlayout(layoutkind.sequential,&pack=1)]internal&struct&driverstatus{public&byte&public&byte&[marshalas(unmanagedtype.byvalarray,&sizeconst=2)]public&byte[]&[marshalas(unmanagedtype.byvalarray,&sizeconst=2)]public&uint[]&}[structlayout(layoutkind.sequential,&pack=1)]internal&struct&sendcmdoutparams{public&uint&public&driverstatus&public&idsector&}[structlayout(layoutkind.sequential,&pack=1,&size=512)]internal&struct&idsector{public&ushort&public&ushort&public&ushort&public&ushort&public&ushort&public&ushort&public&ushort&[marshalas(unmanagedtype.byvalarray,&sizeconst=3)]public&ushort[]&[marshalas(unmanagedtype.byvalarray,&sizeconst=20)]public&byte[]&public&ushort&public&ushort&public&ushort&[marshalas(unmanagedtype.byvalarray,&sizeconst=8)]public&byte[]&[marshalas(unmanagedtype.byvalarray,&sizeconst=40)]public&byte[]&public&ushort&public&ushort&public&ushort&public&ushort&wreserved1;public&ushort&public&ushort&public&ushort&public&ushort&public&ushort&public&ushort&wnumcupublic&uint&ulcpublic&ushort&public&uint&ultotpublic&ushort&public&ushort&[marshalas(unmanagedtype.byvalarray,&sizeconst=128)]public&byte[]&}#endregion/**////&&summary&///&atapi驱动器相关///&&/summary&public&class&atapidevice{dllimport#region&dllimport[dllimport("kernel32.dll",&setlasterror=true)]static&extern&int&closehandle(intptr&hobject);[dllimport("kernel32.dll",&setlasterror=true)]static&extern&intptr&createfile(string&lpfilename,uint&dwdesiredaccess,uint&dwsharemode,intptr&lpsecurityattributes,uint&dwcreationdisposition,uint&dwflagsandattributes,intptr&htemplatefile);[dllimport("kernel32.dll")]static&extern&int&deviceiocontrol(intptr&hdevice,uint&dwiocontrolcode,intptr&lpinbuffer,uint&ninbuffersize,ref&getversionoutparams&lpoutbuffer,uint&noutbuffersize,ref&uint&lpbytesreturned,[out]&intptr&lpoverlapped);[dllimport("kernel32.dll")]static&extern&int&deviceiocontrol(intptr&hdevice,uint&dwiocontrolcode,ref&sendcmdinparams&lpinbuffer,uint&ninbuffersize,ref&sendcmdoutparams&lpoutbuffer,uint&noutbuffersize,ref&uint&lpbytesreturned,[out]&intptr&lpoverlapped);const&uint&dfp_get_version&=&0x;const&uint&dfp_send_drive_command&=&0x;const&uint&dfp_receive_drive_data&=&0x;const&uint&generic_read&=&0x;const&uint&generic_write&=&0x;const&uint&file_share_read&=&0x;const&uint&file_share_write&=&0x;const&uint&create_new&=&1;const&uint&open_existing&=&3;#endregiongethddinfo#region&gethddinfo/**////&&summary&///&获得硬盘信息///&&/summary&///&&param&name="driveindex"&硬盘序号&/param&///&&returns&硬盘信息&/returns&///&&remarks&///&参考lu0的文章:http://lu0s1.3322.org/app/2k1103.html///&by&sunmast&for&everyone///&thanks&lu0&for&his&great&works///&在windows&98/me中,s.m.a.r.t并不缺省安装,请将smartvsd.vxd拷贝到%system%\iosubsys目录下。///&在windows&下,需要administrators组的权限。///&&/remarks&///&&example&///&atapidevice.gethddinfo()///&&/example&public&static&harddiskinfo&gethddinfo(byte&driveindex){switch(environment.osversion.platform){case&platformid.win32windows:return&gethddinfo9x(driveindex);case&platformid.win32nt:return&gethddinfont(driveindex);case&platformid.win32s:throw&new&notsupportedexception("win32s&is&not&supported.");case&platformid.wince:throw&new&notsupportedexception("wince&is&not&supported.");default:throw&new&notsupportedexception("unknown&platform.");}}gethddinfo9x#region&gethddinfo9xprivate&static&harddiskinfo&gethddinfo9x(byte&driveindex){getversionoutparams&vers&=&new&getversionoutparams();sendcmdinparams&inparam&=&new&sendcmdinparams();sendcmdoutparams&outparam&=&new&sendcmdoutparams();uint&bytesreturned&=&0;intptr&hdevice&=&createfile(@"\\.\smartvsd",0,0,intptr.zero,create_new,0,intptr.zero);if&(hdevice&==&intptr.zero){throw&new&exception("open&smartvsd.vxd&failed.");}if&(0&==&deviceiocontrol(hdevice,dfp_get_version,intptr.zero,0,ref&vers,(uint)marshal.sizeof(vers),ref&bytesreturned,intptr.zero)){closehandle(hdevice);throw&new&exception("deviceiocontrol&failed:dfp_get_version");}//&if&ide&identify&command&not&supported,&failsif&(0&==&(vers.fcapabilities&&&1)){closehandle(hdevice);throw&new&exception("error:&ide&identify&command&not&supported.");}if&(0&!=&(driveindex&&&1)){inparam.irdriveregs.bdriveheadreg&=&0xb0;}else{inparam.irdriveregs.bdriveheadreg&=&0xa0;}if&(0&!=&(vers.fcapabilities&&&(16&&&&driveindex))){//&we&don''t&detect&a&atapi&device.closehandle(hdevice);throw&new&exception(string.format("drive&{0}&is&a&atapi&device,&we&don''t&detect&it",driveindex&+&1));}else{inparam.irdriveregs.bcommandreg&=&0xec;}inparam.bdrivenumber&=&inparam.irdriveregs.bsectorcountreg&=&1;inparam.irdriveregs.bsectornumberreg&=&1;inparam.cbuffersize&=&512;if&(0&==&deviceiocontrol(hdevice,dfp_receive_drive_data,ref&inparam,(uint)marshal.sizeof(inparam),ref&outparam,(uint)marshal.sizeof(outparam),ref&bytesreturned,intptr.zero)){closehandle(hdevice);throw&new&exception("deviceiocontrol&failed:&dfp_receive_drive_data");}closehandle(hdevice);return&getharddiskinfo(outparam.bbuffer);}#endregiongethddinfont#region&gethddinfontprivate&static&harddiskinfo&gethddinfont(byte&driveindex){getversionoutparams&vers&=&new&getversionoutparams();sendcmdinparams&inparam&=&new&sendcmdinparams();sendcmdoutparams&outparam&=&new&sendcmdoutparams();uint&bytesreturned&=&0;//&we&start&in&nt/win2000intptr&hdevice&=&createfile(string.format(@"\\.\physicaldrive{0}",driveindex),generic_read&|&generic_write,file_share_read&|&file_share_write,intptr.zero,open_existing,0,intptr.zero);if&(hdevice&==&intptr.zero){throw&new&exception("createfile&faild.");}if&(0&==&deviceiocontrol(hdevice,dfp_get_version,intptr.zero,0,ref&vers,(uint)marshal.sizeof(vers),ref&bytesreturned,intptr.zero)){closehandle(hdevice);throw&new&exception(string.format("drive&{0}&may&not&exists.",driveindex&+&1));}//&if&ide&identify&command&not&supported,&failsif&(0&==&(vers.fcapabilities&&&1)){closehandle(hdevice);throw&new&exception("error:&ide&identify&command&not&supported.");}//&identify&the&ide&drivesif&(0&!=&(driveindex&&&1)){inparam.irdriveregs.bdriveheadreg&=&0xb0;}else{inparam.irdriveregs.bdriveheadreg=0xa0;}if&(0&!=&(vers.fcapabilities&&&(16&&&&driveindex))){//&we&don''t&detect&a&atapi&device.closehandle(hdevice);throw&new&exception(string.format("drive&{0}&is&a&atapi&device,&we&don''t&detect&it.",driveindex&+&1));}else{inparam.irdriveregs.bcommandreg&=&0xec;}inparam.bdrivenumber&=&inparam.irdriveregs.bsectorcountreg&=&1;inparam.irdriveregs.bsectornumberreg&=&1;inparam.cbuffersize&=&512;if&(0&==&deviceiocontrol(hdevice,dfp_receive_drive_data,ref&inparam,(uint)marshal.sizeof(inparam),ref&outparam,(uint)marshal.sizeof(outparam),ref&bytesreturned,intptr.zero)){closehandle(hdevice);throw&new&exception("deviceiocontrol&failed:&dfp_receive_drive_data");}closehandle(hdevice);return&getharddiskinfo(outparam.bbuffer);}#endregionprivate&static&harddiskinfo&getharddiskinfo(idsector&phdinfo){harddiskinfo&hddinfo&=&new&harddiskinfo();changebyteorder(phdinfo.smodelnumber);hddinfo.modulenumber&=&encoding.ascii.getstring(phdinfo.smodelnumber).trim();changebyteorder(phdinfo.sfirmwarerev);hddinfo.firmware&=&encoding.ascii.getstring(phdinfo.sfirmwarerev).trim();changebyteorder(phdinfo.sserialnumber);hddinfo.serialnumber&=&encoding.ascii.getstring(phdinfo.sserialnumber).trim();hddinfo.capacity&=&phdinfo.ultotaladdressablesectors&/&2&/&1024;return&}private&static&void&changebyteorder(byte[]&chararray){byte&for(int&i&=&0;&i&&&chararray.&i&+=&2){temp&=&chararray&=&chararray[i+1];chararray[i+1]&=&}}#endregion}}
在windows 98/me中,s.m.a.r.t并不缺省安装,请将smartvsd.vxd拷贝到%system%\iosubsys目录下。
在windows 下,需要administrators组的权限。
不要在装有scsi硬盘的机器上尝试了,因为scsi硬盘根本不存在序列号。搜索此文相关文章:此文来自: 马开东博客
网址: 站长QQ
如何获得硬盘序列号_博客园相关文章
博客园_总排行榜
博客园_最新
博客园_月排行榜
博客园_周排行榜
博客园_日排行榜当前位置:
&如何获得光盘上的序列号?
如何获得光盘上的序列号?
如今市面上有很多加密光盘,这些光盘是以特殊形式刻录的。将它放入光驱后,会出现一个软件的安装画面要你输入序列号,如果你的光盘序列号弄丢了或者光盘上的序列号根本就不对,而导致无法进行光盘文件的安装,此时你是不是很急呢?那就按照下面的方法来操作吧。
1.用UltraEdit等16进制编辑器直接找到序列号。
运行UltraEdit,用他打开光盘根目录下的SETUP.EXE,然后点击菜单上的“搜索—&查找”,在弹出的对话框“查找什么”栏中填入“请输入序列号”,注意要将多选框“查找ASCII字符”勾选上,回车。找到的“请输入序列号”后面的数字就是序列号了。
&&2.用ISOBuster等光盘刻录软件直接浏览光盘上的隐藏文件。
运行ISOBuster,选择加密光盘所在光驱,点击选择栏旁边的刷新按钮,此时他就会读取你光盘中的文件,这时你就会发现在左边的文件浏览框中多出来一个文件夹,里面就是你真正想要的文件,现在你就可以运行或复制这些文件了。
取得序列号就这么简单,大家也来试试吧
[ Last edited by 幻影无痕 on
at 07:35 ]
24小时热帖
下载小木虫APP
与700万科研达人随时交流PS CS6(PS6)序列号
Photoshop cs6序列号及破解栏目为大家详细讲解Photoshop cs6的破解方法,提供Photoshop cs6序列号及破解教程,让您畅快体验Photoshop cs6.
欢迎大家加入【PS265资源共享交流群】(群②(未满)),更多精彩PS资源等着您。本站高价征稿,必须原创,最低10元/稿!有意咨询QQ!
Photoshop(ps) cs6破解文件下载
pscs6破解文件亲测可用,终于能用了不再出现那个烦人的购买页面了,解压后得到32和64两个文件夹,根据自己的系统类型选择,64位系统请选择64文件夹,复制里面的amtlib文件,替...
经常在网上求Photoshop cs6序列号,但经常都是过期的,无效的,在这里,本站为大家分享Photoshop cs6注册机,自动生成注册码,绝对无毒,亲测可用。
不过这种方式生成的序列号并不是官方正版序...
Photoshop cs6破解激活常用的方法主要有三种:
1,采用正版序列号,直接输入正版序列号安装;
2,采用破解补丁破解;
3,通过修改hosts文件破解:目的是屏蔽Photoshop cs6连接Adobe 的激活...
通过修改hosts文件来破解的时候需要输入Photoshop cs6安装序列号
修改hosts文件的目的是屏蔽Photoshop cs6连接Adobe 的激活验证服务器。修改hosts文件的步骤如下:1. 以“试用版”的方式安装Pho...
各位童鞋注意了:不能只使用本站序列号,由于网络版本众多,请使用我们提供的软件和序列号一起使用,保证正式完整版,支持在线更新。
最新Photoshop cs6正版软件及序列号
下载:http://pan.baidu.com/s...
photoshop CS6正版序列号,永久使用:85-96 ——
如果安装有问题,可以下载Photoshop CS6正版软件,按照里...
最新ps6序列号 支持在线更新 永久免费可用
一、 PS6序列号
使用序列号安装ps6,主要有两种方式,一种是从官方正版序列号,能通过联网验证;第二种是必须使用破解补丁,或是通过修改hosts文件的方式来激活。
PS6序列号...
photoshop是ADOBE公司旗下最为出名的图像处理软件软件之一。如今,photoshop已成为图像处理软件的标准。
Photoshop cs6集图像扫描、编辑修改、动画制作、图像制作、广告创意,图像输入与输出于一体的图形图像处理软件...
photoshop cs6软件下载及官方正版序列号:
http://www.ps265.com/ps/photoshop-cs3-...
pscs6安装序列号:
Photoshop CS6正版序列号,永久使用:85-96
如果安装有问题,可以下载Photoshop CS6正版软件,按照里面的说明,保证正确安装,永久使用。
ps序列号cs6,Photoshop cs6 正版序列号:85-96
photoshop cs6正版软件及序列号下载:http://pan.baidu.com/s/1jGrBSYq
本站ps6序列号保证能用,支持在线更新,永久使用,请下载配套软件安装,如果不下载配套软件有可能安装不成功!
ps6正版序列号:85-96
ps6正版软件及序列号下载:ht...
有幸成为PS资源的成员。用了很久的PS6突然今天不能用了。我的系统是WIN8.1 64位。看到站里有,结果无法下载真正的文件,不知何故,太想得到各位的帮助。先谢过了。
adobe ps cs6 序列号 mac版
希望对你有所帮助如果不可以用,本站提供你最新Photoshop cs6各版本软件下载安装及破解!通过修改文件屏蔽Photoshop向adobe主机验证序列号。
屏蔽方法:1.在安装软件前,或者是软件安装后未启动前,用记事本编辑“C:\Wi...
本软件为Photoshop cs5/6正版序列号安装,不是破解版。安装请参考安装方法图解,cs5 cs6的安装方法一样的。谢谢!我们提供cs5/6两个版本正版软件打包下载,里面包含Photoshop cs5/6安装软件,正版序列号,安装图解...
Powered by}

我要回帖

更多关于 序号怎么自动排序快捷 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信