Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getfreediskspaceex
Message
De
04/04/2002 08:59:20
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/04/2002 08:30:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00640820
Message ID:
00640834
Vues:
36
>Does anyone know how to use the getfreediskspaceex api call from Foxpro?
>
>Technet has the code for VB, but it uses a struct, which I don't know how to translate.
>
>Thanks in advance
>
>Mike Williams
GetFree('c:\')

FUNCTION GetFree
LPARAMETERS tcDirectory
DECLARE short GetDiskFreeSpaceEx IN WIN32API ;
  string @ lpDirectoryName, ;
  string @ lpFreeBytesAvailable, ;
  string @ lpTotalNumberOfBytes, ;
  string @ lpTotalNumberOfFreeBytes
	
STORE SPACE(8*8) TO ;
  lpFreeBytesAvailable, ;
  lpTotalNumberOfBytes, ;
  lpTotalNumberOfFreeBytes

GetDiskFreeSpaceEx(tcDirectory, @lpFreeBytesAvailable, ;
  @lpTotalNumberOfBytes,@lpTotalNumberOfFreeBytes)
? 'FreeBytesAvailable',Str2Num(lpFreeBytesAvailable,8)  
? 'TotalNumberOfBytes',Str2Num(lpTotalNumberOfBytes,8)
? 'TotalNumberOfFreeBytes',Str2Num(lpTotalNumberOfFreeBytes,8)

FUNCTION Str2num
LPARAMETERS tcStr,tnLen
local lnRetVal
lnRetVal = 0
FOR ix=1 TO tnLen
	lnRetVal = lnRetVal + ASC(SUBSTR(tcStr,ix))*(256^(ix-1))
endfor
RETURN TRANSFORM(lnRetVal,'999,999,999,999,999')
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform