USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Dicas

  Visual Basic    (Drives/CD-ROM/Discos)

Título da Dica:  Mostra o espaço em branco do HD
Postada em 17/10/2003 por Tekki            
'No module
Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long

Public Type DiskInformation
lpSectorsPerCluster As Long
lpBytesPerSector As Long
lpNumberOfFreeClusters As Long
lpTotalNumberOfClusters As Long
End Type



'No form
      Dim info As DiskInformation
      Dim lAnswer As Long
      Dim lpRootPathName As String
      Dim lpSectorsPerCluster As Long
      Dim lpBytesPerSector As Long
      Dim lpNumberOfFreeClusters As Long
      Dim lpTotalNumberOfClusters As Long
      Dim lBytesPerCluster As Long
      Dim lNumFreeBytes As Double
      Dim sString As String

      lpRootPathName = "c:\"
      lAnswer = GetDiskFreeSpace(lpRootPathName, lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters)
      lBytesPerCluster = lpSectorsPerCluster * lpBytesPerSector
      lNumFreeBytes = lBytesPerCluster * lpNumberOfFreeClusters
      sString = "Number of Free Bytes : " & lNumFreeBytes & vbCr & vbLf
      sString = sString & "Number of Free Kilobytes: " & (lNumFreeBytes / 1024) & "K" & vbCr & vbLf
      sString = sString & "Number of Free Megabytes: " & Format(((lNumFreeBytes / 1024) / 1024), "0.00") & "MB"

      MsgBox sString
 


CyberWEB Network Ltda.    © Copyright 2000-2024   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página