vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Zippen wie die Profis!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Fortgeschrittene Programmierung
Re: filesystemobject --> andre Lösung Teil 2 
Autor: T.i.m.
Datum: 30.03.05 18:07

' ---------------------------------------------------------------------------
' Define local variables
' ---------------------------------------------------------------------------
  Dim lngHandle                 As Long
  Dim lngRetCode                As Long
  Dim lngProcAddress            As Long
  Dim lngSectorsPerCluster      As Long
  Dim lngBytesPerSector         As Long
  Dim lngNumberOfFreeClusters   As Long
  Dim lngTotalNumberOfClusters  As Long
  Dim curFreeBytesToCaller      As Currency
  Dim curTotalFreeBytes         As Currency
  Dim curTotalBytes             As Currency
  Dim strDriveLtr               As String
 
'  Const TWO_GB                  As Double = 2147483647#
  Const TWO_GB                  As Double = 2200000000#
 
' ---------------------------------------------------------------------------
' Initialize variables
' ---------------------------------------------------------------------------
  dblFreeSpace = 0
  dblTotalSpace = 0
  dblUsedSpace = 0
  curFreeBytesToCaller = 0
  curTotalFreeBytes = 0
  curTotalBytes = 0
  lngSectorsPerCluster = 0
  lngBytesPerSector = 0
  lngNumberOfFreeClusters = 0
  lngTotalNumberOfClusters = 0
  strDriveLtr = Trim$(strPath)
 
' ---------------------------------------------------------------------------
' Verify data was passed
' ---------------------------------------------------------------------------
  If Len(Trim$(strDriveLtr)) = 0 Then
      Exit Function
  End If
 
' ---------------------------------------------------------------------------
' Remove any trailing backslashes
' ---------------------------------------------------------------------------
  strDriveLtr = Left$(strDriveLtr, 1) & ":"
 
  On Error GoTo Over_2gb_Not_Supported
' ---------------------------------------------------------------------------
' First, determine if we can call the GetDiskFreeSpaceEx function.
' ---------------------------------------------------------------------------
  lngHandle = LoadLibrary("kernel32.Dll")
 
' ---------------------------------------------------------------------------
' if the return code is not zero, we were successful
' ---------------------------------------------------------------------------
  If lngHandle Then
      lngProcAddress = GetProcAddress(lngHandle, "GetDiskFreeSpaceExA")
 
      If lngProcAddress Then
 
          ' Make API call to query the hard drive for space information.
          ' if there is an error, we will assume that this operating
          ' system does not support hard drives over 2gb and then jump
          ' to the area where we can make the correct API call.
          lngRetCode = GetDiskFreeSpaceEx(strDriveLtr, _
                                          curFreeBytesToCaller, _
                                          curTotalBytes, _
                                          curTotalFreeBytes)

*greetz*
Tim
.
http://www.DotNetWorld.de

alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
filesystemobject --> Permission denied870Ewok30.03.05 14:23
Re: filesystemobject --> andere Lösung Teil 1549T.i.m.30.03.05 18:06
Re: filesystemobject --> andre Lösung Teil 2560T.i.m.30.03.05 18:07
Re: filesystemobject --> andere Lösung Teil 3578T.i.m.30.03.05 18:08

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel