Herkese selamlar, bir klasorun toplam boyutunu (alt klasorler dahil) oğrenmeye calışıyorum. (Orneğin C:\Windows = 7500 MB gibi.)
Şu kodları buldum ama nasıl kullanacağımı bilemedim. (modul kullanmak şartmı cunku hic bilmiyorum) Hangi kodları nereye ekleyip, sonucu (msgbox,label vs..) nasıl alacağım konusunda yardımcı olabilirmisiniz. Şimdiden cok teşekkur ederim.

Kodları aldığım sitenin linki: burda

Alıntı:
Imports System
Imports System.Linq
Imports System.IO

Module Module1

Sub Main()
Dim dInfo As New DirectoryInfo("C:/Articles")
' set bool parameter to false if you
' do not want to include subdirectories.
Dim sizeOfDir As Long = DirectorySize(dInfo, True)

Console.WriteLine("Directory size in Bytes : " & _
" Bytes", sizeOfDir)
Console.WriteLine("Directory size in KB : " & _
" KB", (CDbl(sizeOfDir)) / 1024)
Console.WriteLine("Directory size in MB : " & _
" MB", (CDbl(sizeOfDir)) / (1024 * 1024))

Console.ReadLine()
End Sub

Private Function DirectorySize(ByVal dInfo As DirectoryInfo, _
ByVal includeSubDir As Boolean) As Long
' Enumerate all the files
Dim totalSize As Long = dInfo.EnumerateFiles() _
.Sum(Function(file) file.Length)

' If Subdirectories are to be included
If includeSubDir Then
' Enumerate all sub-directories
totalSize += dInfo.EnumerateDirectories() _
.Sum(Function(dir) DirectorySize(dir, True))
End If
Return totalSize
End Function

End Module

__________________