又来一帖:获得硬盘序列号问题?
vb里可以,但是打包成组件后asp里却得不到值呢(组件已注册成功)?源码如下
Option Explicit
'--------------------------------------------------------------------------
' 模 块: 取磁盘硬件信息处理类
' 版 本: 1.0
' 文件名: CDiskInfo.cls
' 作者: 林天炮
' 修改日期:2003-03-13
' 2003-04-02 艾会武 改动 aihuiwu@163.com
'
' 功能说明:获取硬盘序列号、型号、磁道扇区信息等
' 版权说明:此为共享代码,根据微软提供的例程改编,可以任意修改及使用,
' 作者对此模块运行所引起的错误不承担任何责任。
'
' 引用此模块时须保留作者署名,有意见或错误请发送至ltpao@sina.com
'
' 注意事项:支持Windows 95 OSR2, Windows 98, Windows NT, Windows 2000
' XP没有测试,估计没问题,在Win9X下必须保证存在SMARTVSD.vxd
'--------------------------------------------------------------------------
'/****************************************************************************
'* *
'* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY *
'* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE *
'* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR *
'* PURPOSE. *
'* *
'* Copyright 1993-98 Microsoft Corporation. All Rights Reserved. *
'* *
'****************************************************************************/
Private Const MAX_IDE_DRIVES As Long = 4 ' Max number of drives assuming primary/secondary, master/slave topology
Private Const READ_ATTRIBUTE_BUFFER_SIZE As Long = 512
Private Const IDENTIFY_BUFFER_SIZE As Long = 512
Private Const READ_THRESHOLD_BUFFER_SIZE As Long = 512
'Private ndisk As String
'
' IOCTL commands
'
Private Const DFP_GET_VERSION As Long = &H74080
Private Const DFP_SEND_DRIVE_COMMAND As Long = &H7C084
Private Const DFP_RECEIVE_DRIVE_DATA As Long = &H7C088
'---------------------------------------------------------------------
' GETVERSIONOUTPARAMS contains the data returned from the
' Get Driver Version function.
'---------------------------------------------------------------------
Private Type GETVERSIONOUTPARAMS
bVersion As Byte ' Binary driver version.
bRevision As Byte ' Binary driver revision.
bReserved As Byte ' Not used.
bIDEDeviceMap As Byte ' Bit map of IDE devices.
fCapabilities As Long ' Bit mask of driver capabilities.
dwReserved(3) As Long ' For future use.
End Type
'
' Bits returned in the fCapabilities member of GETVERSIONOUTPARAMS
'
Private Const CAP_IDE_ID_FUNCTION As Long = 1 ' ATA ID command supported
Private Const CAP_IDE_ATAPI_ID As Long = 2 ' ATAPI ID command supported
Private Const CAP_IDE_EXECUTE_SMART_FUNCTION As Long = 4 ' SMART commannds supported
'---------------------------------------------------------------------
' IDE registers
'---------------------------------------------------------------------
Private Type IDEREGS
bFeaturesReg As Byte ' Used for specifying SMART "commands".
bSectorCountReg As Byte ' IDE sector count register
bSectorNumberReg As Byte ' IDE sector number register
bCylLowReg As Byte ' IDE low order cylinder value
bCylHighReg As Byte ' IDE high order cylinder value
bDriveHeadReg As Byte ' IDE drive/head register
bCommandReg As Byte ' Actual IDE command.
bReserved As Byte ' reserved for future use. Must be zero.
End Type
'---------------------------------------------------------------------
' SENDCMDINPARAMS contains the input parameters for the
' Send Command to Drive function.
'---------------------------------------------------------------------