Guidance
指路人
g.yi.org
software / rapidq / Examples / File & Directory / space_on_drive.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
' ========== DRIVE ON SPACE ====================================
' DANIEL CALERO : contact@dclogiciel.fr.st
'
' (12/30/2002) Example found at the following address :
'    http://support.microsoft.com/default.aspx?scid=KB;en-us;q147686
' This exemple shows how to find out how much free disk space
'  is available on the current drive by calling the DiskSpaceFree
'  function found in STKIT432.DLL for Windows.
' Do not forget to copy the DLL in your working file or in that of WINDOWS.
'
' (30/12/2002) Exemple trouvé à l'adresse suivante :
'    http://support.microsoft.com/default.aspx?scid=KB;en-us;q147686
'Cet exemple montre comment découvrir combien d'espace disque libre
' est disponible sur la commande actuelle en appelant la fonction
' de DiskSpaceFree trouvée dans STKIT432.DLL pour WINDOWS.
'N'oubliez pas de copier la DLL dans votre dossier de travail
'  ou dans celui de WINDOWS.

     DECLARE FUNCTION DiskSpaceFree LIB "STKIT432.DLL" ALIAS _
      "DISKSPACEFREE" () AS LONG

     DECLARE SUB command1_click

     DIM Form AS QFORM
     WITH Form
      .CAPTION = "SPACE ON DRIVE"
      .Width = 320
      .Height = 240
      .Center
     END WITH
     DIM label1 AS QLABEL
     WITH Label1
      .PARENT = form
      .CAPTION = "Label1"
      .Wordwrap = 1
      .Left = 2
      .Top = 20
      .Transparent = 1
      .width = 300
     END WITH
     DIM command1 AS QBUTTON
     WITH command1
      .PARENT = form
      .CAPTION = "Press for free space on drive space on drive c"
      .Left = 32
      .Top = 93
      .Width = 259
      .onclick = command1_click
     END WITH

     Form.SHOWMODAL

     SUB Command1_Click
      DIM free_Space AS LONG
      CHDRIVE "c:"
      free_Space = DiskSpaceFree()
      Label1.CAPTION = "The total free space on Drive C: = " _
       & STR$(free_Space) & " bytes or "& STR$(free_space/1048576)& _
       " méga bytes or " & STR$(free_space/1073741824)& " giga bytes."
      ' thank at Igor for debug
     END SUB

掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2023-1-27  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-12-31 19:41:09