asp获取硬盘序列号

来源:互联网 发布:linux安装apt get命令 编辑:程序博客网 时间:2024/05/01 21:19

以下是代码片段:


<%
 Sub ShowDriveInfo(drvpath)
    Dim fs, d, s, t
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
    Select Case d.DriveType
        Case 0: t = "未知"
        Case 1: t = "可移动"
        Case 2: t = "固定"
        Case 3: t = "网络"
        Case 4: t = "CD-ROM"
        Case 5: t = "RAM 磁盘"
    End Select
    s = "驱动器 " & d.DriveLetter & ": - " & t
    s = s & vbCrLf & "序列号: " & d.SerialNumber
    response.Write(s)
End Sub
call ShowDriveInfo("c:/")
%>
 

原创粉丝点击