Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42220

VS 2010 [RESOLVED] filesize function

$
0
0
Code:

    Public Function getFileSize(ByVal path As String) As String
        Dim sizes() As String = New String() {"B", "KB", "MB", "GB"}
        Dim len As Double = (New FileInfo(path) + Length)
        Dim order As Integer = 0

        While ((len >= 1024) _
                    AndAlso (order + (1 < sizes.Length)))
            order = (order + 1)
            len = (len / 1024)

        End While
        Return String.Format("{0:0.##} {1}", len, sizes(order))
    End Function

Can anyone help, why do i get: Error 1 'Length' is not declared. It may be inaccessible due to its protection level. H:\X17-59183\PostInstall\PostInstall\SelectPrograms.vb 111 51 PostInstall

Viewing all articles
Browse latest Browse all 42220

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>