22/03/2016, 14:28
megasoftware
Ms-Dos ortamında VOL değerine baktığım da değer : 0223-6EC9 ancak fonksiyon başa sıfır geldiğinde 2236-6EC9 olarak değeri geri döndürüyor. Acaba nerede hata yapıyorum
Kod:
Option Compare Database
Option Explicit
Private Declare Function GetVolumeSerialNumber Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
Public Function VolumeSerialNumber(ByVal RootPath As String) As String
Dim VolLabel As String
Dim VolSize As Long
Dim Serial As Long
Dim MaxLen As Long
Dim Flags As Long
Dim Name As String
Dim NameSize As Long
Dim Deger As String
If GetVolumeSerialNumber(RootPath, VolLabel, VolSize, Serial, MaxLen, Flags, Name, NameSize) Then
Deger = Format(Hex(Serial), "#########")
VolumeSerialNumber = Left(Deger, 4) + "-" + Right(Deger, 4)
MsgBox VolumeSerialNumber, vbOKOnly, "Class Bilgisayar © 2016"
Else
End If
End Function