Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

silas_i

Tamanho de umas pasta no server

Recommended Posts

Pessoal eu não lembro como se faz para mostrar o tamanho de uma certa pasta no servidor !?Alguém sabe !? é feito em FSO, certo !?valeu pela ajuda !

Compartilhar este post


Link para o post
Compartilhar em outros sites

beleza, Silas?

Dá uma olhada aqui que tem o q você quer

Compartilhar este post


Link para o post
Compartilhar em outros sites

Legal... eu consegui uma função que já mostra o tamanho em MB, GB e etc...

 

<%' Formats given size in bytes,KB,MB and GB    Function FormatSize (givenSize)       If (givenSize < 1024) Then          FormatSize = givenSize & " B"       ElseIf (givenSize < 1024*1024) Then          FormatSize = FormatNumber(givenSize/1024,2) & " KB"       ElseIf (givenSize < 1024*1024*1024) Then          FormatSize = FormatNumber(givenSize/(1024*1024),2) & " MB"       Else          FormatSize = FormatNumber(givenSize/(1024*1024*1024),2) & " GB"       End If    End Function         givenSize = "d:\dominio.com.br\"Set fso = Server.CreateObject("Scripting.FileSystemObject") Set pasta = fso.GetFolder(givenSize) Response.Write FormatSize(pasta.Size)       %>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Legal... eu consegui uma função que já mostra o tamanho em MB, GB e etc...

 

<%

' Formats given size in bytes,KB,MB and GB

  Function FormatSize (givenSize)

      If (givenSize < 1024) Then

        FormatSize = givenSize & " B"

      ElseIf (givenSize < 1024*1024) Then

        FormatSize = FormatNumber(givenSize/1024,2) & " KB"

      ElseIf (givenSize < 1024*1024*1024) Then

        FormatSize = FormatNumber(givenSize/(1024*1024),2) & " MB"

      Else

        FormatSize = FormatNumber(givenSize/(1024*1024*1024),2) & " GB"

      End If

  End Function

        givenSize = "d:\dominio.com.br\"

Set fso = Server.CreateObject("Scripting.FileSystemObject")

Set pasta = fso.GetFolder(givenSize)

Response.Write FormatSize(pasta.Size)

     

%>

Salgado... se você quiser coloca na área de códigos !!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.