久久―日本道色综合久久,亚洲欧美精品在线,狼狼色丁香久久婷婷综合五月,香蕉人人超,日本网站黄,国产在线观看不卡免费高清,无遮挡的毛片免费

2023信創(chuàng)獨角獸企業(yè)100強
全世界各行各業(yè)聯(lián)合起來,internet一定要實現(xiàn)!

VB取磁盤序列號卷標(biāo)和文件系統(tǒng)類型

2004-02-20 eNet&Ciweek

  聲明:

Private Declare Function GetVolumeInformation Lib "kernel32.dll" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Integer, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long


  代碼:

Function GetSerialNumber(sRoot As String) As Long
Dim lSerialNum As Long
Dim R As Long
Dim sTemp1 As String, sTemp2 As String
strLabel = String$(255, Chr$(0))
注釋: 磁盤卷標(biāo)
strType = String$(255, Chr$(0))
注釋: 文件系統(tǒng)類型 一般為 FAT
R = GetVolumeInformation(sRoot, strLabel, Len(strLabel), lSerialNum, 0, 0, strType, Len(strType))
GetSerialNumber = lSerialNum
注釋:在 strLabel 中為 磁盤卷標(biāo)
注釋:在 strType 中為 文件系統(tǒng)類型
End Function



  用法:

  當(dāng)驅(qū)動器不存在時,函數(shù)返回 0。如果是個非根目錄,也將返回 0:

lSerial = GetSerialNumber("c:\")

相關(guān)頻道: eNews

您對本文或本站有任何意見,請在下方提交,謝謝!

投稿信箱:tougao@enet16.com