• 0
Sign in to follow this  

Espaço Em Disco


Gostaria de saber como que faço para o asp mostrar quantos espaço tem o meu disco e quantos espaço esta sendo usado

Share this post

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0


você deu sorte achei este exemplo:

Dim fso, drv, s
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set drv = fso.GetDrive(fso.GetDriveName(drvPath))
  s = "Drive " & UCase(drvPath) & " - "
  s = s & drv.VolumeName & "<br>"
  s = s & "Total Space: " & FormatNumber(drv.TotalSize / 1024, 0)
  s = s & " Kb" & "<br>"
  s = s & "Free Space: " & FormatNumber(drv.FreeSpace / 1024, 0)
  s = s & " Kb" & "<br>"
  Response.Write s
Mas fica este também só com curiosidade:
Dim FSO 
    Dim Drives
    Dim Drive
    Dim S

    Set FSO = CreateObject("Scripting.FileSystemObject")

    Set Drives = FSO.Drives%>

    <table border="1">
            <td>Espaço total:</td>    
            <td>Espaço livre:</td>    
            <td>Espaço disponivel:</td>    

        <%For Each Drive In Drives%>
            <%    If Drive.IsReady Then
                    If DriveTypeNetwork = Drive.DriveType Then
                        S = S & TabStop & Drive.ShareName 
                        S = S & TabStop & Drive.VolumeName 
                    End If    %>
            <%    End If%>

            Set FSO = Nothing
            response.write S%>


Acho que já tens mateiral para começar a pensar no assunto.


Edited by jothaz

Share this post

Link to post
Share on other sites
  • 0
Guest --Everton --

tem esse que é muito facil e que da o espaço em byts


set fs =server.createobject("scripting.filesystemobject")

set disco = fs.getdrive ("c:\")

response.write("tamanho total de c: em bytes: " & disco.totalsize)

set disco = nothing

set fs = nothing


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this