Sign in to follow this  
smez

Espaço Em Disco

Recommended Posts

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

Camarada,

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">
        <tr>                    
            <td>Drive:</td>    
            <td>Espaço total:</td>    
            <td>Espaço livre:</td>    
            <td>Espaço disponivel:</td>    
        </tr>

        <%For Each Drive In Drives%>
            <tr>
            <%    If Drive.IsReady Then
                    If DriveTypeNetwork = Drive.DriveType Then
                        S = S & TabStop & Drive.ShareName 
                    Else
                        S = S & TabStop & Drive.VolumeName 
                    End If    %>
                        <td><%=Drive.FileSystem%></td>
                        <td><%=Drive.TotalSize%></td>
                        <td><%=Drive.FreeSpace%></td>
                        <td><%=Drive.AvailableSpace%></td>                                                
            <%    End If%>
            </tr>
            <%Next  

            Set FSO = Nothing
            response.write S%>
    </table>    

<%Response.End%>

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

t+

Edited by jothaz

Share this post


Link to post
Share on other sites
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.

Guest
Reply to this topic...

×   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