当前位置: 网学 > 编程文档 > VB > 正文

直接从RING3获取硬盘序列号

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/16
下载{$ArticleTitle}原创论文样式
***************************************************************************
'' cerr<<endl<<"HDD identifier v1.0 for WIN95/98/Me/NT/2000. written by Lu Lin"<<endl
'' cerr<<"For more information, please visit Inside Programming: http:''lu0.126.com"<<endl
'' cerr<<"2000.11.3"<<endl<<endl
''****************************************************************************
Dim StrMsg As String
StrMsg = StrMsg & "直接从RING3调用API DeviceIoControl()来获取硬盘信息的VB程序 "
StrMsg = StrMsg & vbCrLf & "VC源作板权信息如下:"
StrMsg = StrMsg & vbCrLf & "***********************************************************"
StrMsg = StrMsg & vbCrLf & "HDD identifier v1.0 for WIN95/98/Me/NT/2000. written by Lu Lin"
StrMsg = StrMsg & vbCrLf & "For more information, please visit Inside Programming: http://lu0.126.com"
StrMsg = StrMsg & vbCrLf & "2000.11.3"
StrMsg = StrMsg & vbCrLf & "***********************************************************"
StrMsg = StrMsg & vbCrLf & "VB程序编制:BARDO"
StrMsg = StrMsg & vbCrLf & "网站:东方热讯:http://www.easthot.net"
StrMsg = StrMsg & vbCrLf & "邮件:sales@easthot.net"
StrMsg = StrMsg & vbCrLf & "2003.01.23"
MsgBox StrMsg
End Sub

Sub ChangeByteOrder(szString() As Byte, uscStrSize As Long)
    Dim i As Long
    Dim temp As String
     For i = 0 To uscStrSize - 1 Step 2
        temp = szString(i)
        szString(i) = szString(i + 1)
        szString(i + 1) = temp
     Next i
End Sub

Private Function hdid9x() As String

''We start in 95/98/Me
h = CreateFile("\\.\Smartvsd", 0, 0, 0, CREATE_NEW, 0, 0)
If h = 0 Then
    hdid9x = "open smartvsd.vxd failed"
    Exit Function
End If

Dim olp As OVERLAPPED
Dim lRet As Long
lRet = DeviceIoControl(h, DFP_GET_VERSION, ByVal 0&, 0, vers, Len(vers), ByVal i, olp)
If lRet = 0 Then
        hdid9x = "DeviceIoControl failed:DFP_GET_VERSION"
        CloseHandle (h)
        Exit Function
End If

''If IDE identify command not supported, fails
If (vers.fCapabilities And 1) <> 1 Then
    hdid9x = "Error: IDE identify command not supported."
    CloseHandle (h)
    Exit Function
End If

''Display IDE drive number detected
Dim sPreOutStr As String
sPreOutStr = DetectIDE(vers.bIDEDeviceMap)
hdid9x = sPreOutStr

''Identify the IDE drives
For j = 0 To 3
    Dim phdinfo As TIDSECTOR
    Dim s(40) A
  • 下一篇资讯: vb中使用正则表达式
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号