01-12-15, 11:50 PM
(01-12-15, 11:24 PM)adel27 كتب : هو مجلد داخله مجلدات أبي أقيس مساحة جميع المجلدات الداخليه
في رساله واحده
تفضل
PHP كود :
Dim fsize As Long = 0
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim opn As New FolderBrowserDialog
If opn.ShowDialog = Windows.Forms.DialogResult.OK Then
fsize = 0
getSize(opn.SelectedPath)
MsgBox(fsize.ToString & " bytes")
MsgBox(Format(fsize / 1024, "#.000") & " KB")
MsgBox(Format(fsize / 1048576, "#.000") & " MB")
End If
End Sub
Sub getSize(ByVal path_ As String)
For Each file As String In My.Computer.FileSystem.GetFiles(path_)
Dim finnfo As New System.IO.FileInfo(file)
fsize = fsize + finnfo.Length
Next
For Each file As String In My.Computer.FileSystem.GetDirectories(path_)
getSize(file)
Next
End Sub
