• 5 odgovora
  • 6.850 pregleda
Seriski broj hard diska - POMOC 08.02.2004. u 17:19 · pre 276 meseci #1
Kako da pomoci VB 6 ucitam serijski broj Hard diska - POMAGAJTE hitno
Potpis
mipsi
Re: Seriski broj hard diska - POMOC 08.02.2004. u 19:52 · pre 276 meseci #2
Pretraži .NET forum i pogledaj poruke od jc denton-a: nedavno je Neša postavio dll koji pruža tu informaciju.
Potpis
Commercial-Free !!!
Re: Seriski broj hard diska - POMOC 09.02.2004. u 18:59 · pre 276 meseci #4
Jesi li pogledao tu temu? Ako se dobro sećam na istoj je bio i link do koda.
Potpis
Commercial-Free !!!
Re: Seriski broj hard diska - POMOC 10.02.2004. u 08:21 · pre 276 meseci #5
Evo ti kod


Function brojdiska() As String
Dim fs, d, s, t
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(2)))
Select Case d.DriveType
Case 0: t = "Unknown"
Case 1: t = "Removable"
Case 2: t = "Fixed"
Case 3: t = "Network"
Case 4: t = "CD-ROM"
Case 5: t = "RAM Disk"
End Select
s = d.SerialNumber
brojdiska = s
End Function

Pozdrav Zlatko Borojevic
Re: Seriski broj hard diska - POMOC 28.10.2004. u 23:02 · pre 267 meseci #6
Code:

Private Declare Function GetVolumeInformation 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
'Br-Naziv diska "C:\")
Function BrojP(Br As String) As String
Dim Root As String
Dim Vol_N As String
Dim Ser_Br As Long
Dim Flag As Long
Dim Sys_Ime As String
Dim Pos As Integer
Dim Max_duz

    Root = Br
    Vol_N = Space$(1024)
    Sys_Ime = Space$(1024)

    If GetVolumeInformation(Root, Vol_N, _
        Len(Vol_N), Ser_Br, _
        Max_duz, Flag, _
        Sys_Ime, Len(Sys_Ime)) = 0 _
    Then
        MsgBox "Greška pri definisanju broja"
        Exit Function
    End If

    Pos = InStr(Vol_N, Chr$(0))
    Vol_N = Left$(Vol_N, Pos - 1)

BrojP = Ser_Br
End Function
Potpis
zxz
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme