04 Apr

[VB.NET] Public Class Folder

By saadry

Public Class Folder


This class is very similar to the IO.System.DirectoryInfo Class but contains added feature:

Related Content:

  • Enumerate Directories
  • Calculate Directory Size
  • SearchOptions Features
  • Directories Manipulation

Aim:

To create a Folder Class which can be used to store functions and properties, such as Directory manipulations and indexation.

This class records pre-set configuration needed in order to :

  • Display Files in a FileExplorer Form
  • Visualise information collected in a Listview Object or a DataGridView Object
  • Manipulates Files and data

See Also:

Public Class Fichier


 

Properties

Index

Physical Information

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#Region "<0.1> [Physical Information]"
    'Target
    Private _Target As String
    ''' <summary>
    ''' Define the entire Folderpath of the selected Folder
    ''' </summary>
    ''' <returns></returns>
    Public Property Target() As String
        Get
            Return _Target
        End Get
        Set(ByVal value As String)
            _Target = value
        End Set
    End Property
    'Folder Existe
    Private _Exist As Boolean
    ''' <summary>
    ''' Examine if the Folder exist
    ''' </summary>
    ''' <returns></returns>
    Public Property Exist() As Boolean
        Get
            Return _Exist
        End Get
        Set(ByVal value As Boolean)
            _Exist = value
        End Set
    End Property
    'Folder Name (Name + Extension)
    Private _FolderName As String
    ''' <summary>
    ''' Return the Folder Name without Extension
    ''' </summary>
    ''' <returns></returns>
    Public Property FolderName() As String
        Get
            Return _FolderName
        End Get
        Set(ByVal value As String)
            _FolderName = value
        End Set
    End Property
    'Name
    Private _Name As String
    ''' <summary>
    ''' Return the Folder Name without Extension nor path
    ''' </summary>
    ''' <returns></returns>
    Public Property Name() As String
        Get
            Return _Name
        End Get
        Set(ByVal value As String)
            _Name = value
        End Set
    End Property

    'Folder Extension (Extension with dot)
    Private _Extension As String
    ''' <summary>
    ''' Set or Return the Extension of the Folder
    ''' </summary>
    ''' <returns></returns>
    Public Property Extentsion() As String
        Get
            Return _Extension
        End Get
        Set(ByVal value As String)
            _Extension = value
        End Set
    End Property

    'Folder FullName (Folder Path + Folder Name + Folder Extension)
    Private _FullName As String
    ''' <summary>
    ''' Returns the Full Path of the Folder also used when converting the Folder
    ''' </summary>
    ''' <returns></returns>
    Public Property FullName() As String
        Get
            Return _FullName
        End Get
        Set(ByVal value As String)
            _FullName = value
        End Set
    End Property

    Private _DirInfo As DirectoryInfo
    <CategoryAttribute("DirectoryInfo"), Browsable(True)>
    Public Property DirInfo() As DirectoryInfo
        Get
            Return _DirInfo
        End Get
        Set(ByVal value As DirectoryInfo)
            _DirInfo = value
        End Set
    End Property
#Region "[FolerItem]"
    Private _FolderItem As ListViewItem
    ''' <summary>
    ''' This set the default Path before being analysed
    ''' </summary>
    ''' <returns></returns>
    <CategoryAttribute("FolderItem"), Browsable(True)>
    Public Property FolderItem() As ListViewItem
        Get
            Return _FolderItem
        End Get
        Set(ByVal value As ListViewItem)
            _FolderItem = value
        End Set
    End Property
#End Region
#End Region

DateInformation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#Region "<0.2> [Date Information]"

    'Folder Date Modify
    Private _Modify As DateTime
    ''' <summary>
    ''' Return the last Modified Date of the Folder
    ''' </summary>
    ''' <returns></returns>
    Public Property Modify() As DateTime
        Get
            Return _Modify
        End Get
        Set(ByVal value As DateTime)
            _Modify = value
        End Set
    End Property

    'Folder Date Created
    Private _Created As DateTime
    ''' <summary>
    ''' Return the date of Creation of the Folder
    ''' </summary>
    ''' <returns></returns>
    Public Property Created() As DateTime
        Get
            Return _Created
        End Get
        Set(ByVal value As DateTime)
            _Created = value
        End Set
    End Property

    'Folder Date Accessed
    Private _Accessed As DateTime
    ''' <summary>
    ''' Return the last accessed date of the Folder
    ''' </summary>
    ''' <returns></returns>
    Public Property Accessed() As DateTime
        Get
            Return _Accessed
        End Get
        Set(ByVal value As DateTime)
            _Accessed = value
        End Set
    End Property
#End Region

Size Information

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#Region "<0.3> [Size Information]"
    'Folder Size
    Private _Size As SizeInfo
    ''' <summary>
    ''' Return the converted Size
    ''' -Display : Returns the visual content for the reader (size + Scale)
    ''' -Valeur  : Returns the formated size
    ''' -Text    : Returns the scale (o, byt, kyt, Gyt, Tyt)
    ''' -Raw     : Returns the raw size
    ''' </summary>
    ''' <returns></returns>
    Public Property Size() As SizeInfo
        Get
            Return _Size
        End Get
        Set(ByVal value As SizeInfo)
            _Size = value
        End Set
    End Property
#End Region

Location Information

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#Region "<0.4> [Location Information]"
    'Folder Directory
    Private _Path As DirectoryInfo
    ''' <summary>
    ''' Returns the Directory location of the Folder
    ''' </summary>
    ''' <returns></returns>
    Public Property Path() As DirectoryInfo
        Get
            Return _Path
        End Get
        Set(ByVal value As DirectoryInfo)
            _Path = value
        End Set
    End Property

    'Folder Parent
    Private _Parent As DirectoryInfo
    ''' <summary>
    ''' Returns the Parent directory Folder location
    ''' </summary>
    ''' <returns></returns>
    Public Property Parent() As DirectoryInfo
        Get
            Return _Parent
        End Get
        Set(ByVal value As DirectoryInfo)
            _Parent = value
        End Set
    End Property
#End Region

Data Information

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#Region "<0.5> [Data Information]"
#Region "<Items_File>"
    Private _Items_File As ListViewEx
    ''' <summary>
    ''' Retreive the Files in a listviewEx
    ''' </summary>
    ''' <returns></returns>
    <CategoryAttribute("Liste des sous fichiers"), Browsable(True)>
    Public Property Items_File() As ListViewEx
        Get
            Return _Items_File
        End Get
        Set(ByVal value As ListViewEx)
            _Items_File = value
        End Set
    End Property
#End Region                    
#Region "<Items_Folder>"
    Private _Items_Folder As ListViewEx
    ''' <summary>
    ''' Retreive the Folders in a listviewEx
    ''' </summary>
    ''' <returns></returns>
    <CategoryAttribute("Liste des sous répertoires"), Browsable(True)>
    Public Property Items_Folder() As ListViewEx
        Get
            Return _Items_Folder
        End Get
        Set(ByVal value As ListViewEx)
            _Items_Folder = value
        End Set
    End Property
#End Region                    
#Region "<Count_File>"
    Private _Count_File As Integer
    ''' <summary>
    ''' Retreive the number of files as Integer
    ''' </summary>
    ''' <returns></returns>
    <CategoryAttribute("Nombres de Fichier"), Browsable(True)>
    Public Property Count_File() As Integer
        Get
            Return _Count_File
        End Get
        Set(ByVal value As Integer)
            _Count_File = value
        End Set
    End Property
#End Region                        
#Region "<Count_Folder>"
    Private _Count_Folder As Integer
    ''' <summary>
    ''' Retreive the number of Folders as Integer
    ''' </summary>
    ''' <returns></returns>
    <CategoryAttribute("Nombres de sous répertoires"), Browsable(True)>
    Public Property Count_Folder() As Integer
        Get
            Return _Count_Folder
        End Get
        Set(ByVal value As Integer)
            _Count_Folder = value
        End Set
    End Property
#End Region                        
#Region "<Password>"
    Private _Password As String
    ''' <summary>
    ''' Set the Folder Password
    ''' </summary>
    ''' <returns></returns>
    Public Property Password() As String
        Get
            Return _Password
        End Get
        Set(ByVal value As String)
            _Password = value
        End Set
    End Property
#End Region                          
#End Region

Attributes Information

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#Region "<0.6> [Attributes Information]"
#Region "<Is_Compressed>"
    Private _Is_Compressed As Boolean
    ''' <summary>
    ''' Determine if the Folder is compressed or not
    ''' </summary>
    ''' <returns></returns>
    Public Property Is_Compressed() As Boolean
        Get
            Return _Is_Compressed
        End Get
        Set(ByVal value As Boolean)
            _Is_Compressed = value
        End Set
    End Property
#End Region
#Region "<Is_Convertable>"
    Private _Is_Convertable As Boolean
    ''' <summary>
    ''' Determine if the Folder is convertable or not
    ''' </summary>
    ''' <returns></returns>
    Public Property Is_Convertable() As Boolean
        Get
            Return _Is_Convertable
        End Get
        Set(ByVal value As Boolean)
            _Is_Convertable = value
        End Set
    End Property
#End Region
#Region "<Is_Corrupted>"
    Private _Is_Corrupted As Boolean
    ''' <summary>
    ''' Determine if the Folder is corrupted
    ''' </summary>
    ''' <returns></returns>
    Public Property Is_Corrupted() As Boolean
        Get
            Return _Is_Corrupted
        End Get
        Set(ByVal value As Boolean)
            _Is_Corrupted = value
        End Set
    End Property
#End Region
#Region "<Is_Database>"
    Private _Is_Database As Boolean
    ''' <summary>
    ''' Determine if the Folder is database compatible
    ''' </summary>
    ''' <returns></returns>
    Public Property Is_Database() As Boolean
        Get
            Return _Is_Database
        End Get
        Set(ByVal value As Boolean)
            _Is_Database = value
        End Set
    End Property
#End Region
#Region "<Is_Encrypted>"
    Private _Is_Encrypted As Boolean
    ''' <summary>
    ''' Determine if the Folder is Encrypted
    ''' </summary>
    ''' <returns></returns>
    Public Property Is_Encrypted() As Boolean
        Get
            Return _Is_Encrypted
        End Get
        Set(ByVal value As Boolean)
            _Is_Encrypted = value
        End Set
    End Property
#End Region
#Region "<Is_Exportable>"
    Private _Is_Exportable As Boolean
    ''' <summary>
    ''' Determine if the Folder can be exported
    ''' </summary>
    ''' <returns></returns>
    Public Property Is_Exportable() As Boolean
        Get
            Return _Is_Exportable
        End Get
        Set(ByVal value As Boolean)
            _Is_Exportable = value
        End Set
    End Property
#End Region
#Region "<Is_Hidden>"
    Private _Is_Hidden As Boolean
    ''' <summary>
    ''' Determine if the Folder is Hidden
    ''' </summary>
    ''' <returns></returns>
    Public Property Is_Hidden() As Boolean
        Get
            Return _Is_Hidden
        End Get
        Set(ByVal value As Boolean)
            _Is_Hidden = value
        End Set
    End Property
#End Region
#Region "<Is_Readable>"
    Private _Is_Readable As Boolean
    ''' <summary>
    ''' Determine if the file is readable
    ''' </summary>
    ''' <returns></returns>
    Public Property Is_Readable() As Boolean
        Get
            Return _Is_Readable
        End Get
        Set(ByVal value As Boolean)
            _Is_Readable = value
        End Set
    End Property
#End Region
#End Region

Structure and Enumerations

Structures

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#Region "<SizeInfo>"
    Public Structure SizeInfo
        Public Display As String
        Public Valeur As Double
        Public Text As String
        Public Scale As Size_Scale
        Public Raw As Double
    End Structure
#End Region  
#Region "<S_Indexed>"
    Public Structure S_Indexed
        Public List_file As List(Of FileSystemInfo)
        Public List_Fichiers As List(Of Fichier)
        Public List_Folders As List(Of Folder)
        Public List_Image As List(Of Bitmap)
        Public List As List(Of String)
        Public Binding As BindingSource
        Public Size As SizeInfo
    End Structure
#End Region

Enumeration

1
2
3
4
5
6
7
8
9
#Region "<Size_Scale>"
    Public Enum Size_Scale
        Bytes
        Kilobyte
        Megabyte
        Gigabyte
        Terabyte
    End Enum
#End Region

Functions

Index


<0.1> Directories

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#Region "[Enumeration] <0.1> Directories"
    Public Function EnumerateDirectories(Optional ByVal SearchExpression As String = "*.*",
                                         Optional ByVal SearchOption As SearchOption = SearchOption.TopDirectoryOnly) As S_Indexed
        Dim Result As New S_Indexed
        Result.List_Folders = New List(Of Folder)
        Result.List = New List(Of String)
        Result.List_Image = New List(Of Bitmap)

        Dim Start As String = Target
        Result.List.Add(Start)
        Dim Stack As Stack(Of String) = New Stack(Of String)
        Do
            Try
                Debug.WriteLine(Start)
                Dim dirs = From d In Directory.EnumerateDirectories(Start, SearchExpression, SearchOption)
                           Select d
                'Multline Lambda - Strange
                Array.ForEach(dirs.ToArray(), Sub(d)
                                                  Stack.Push(d)
                                                  Dim F As New Folder(d, False)
                                                  Result.List_Folders.Add(F)
                                                  Dim M As Bitmap = Retrive_Icons.GetShellIcon(d)
                                                  Result.List_Image.Add(M)
                                              End Sub)
                Start = Stack.Pop
                Result.List.Add(Start)
            Catch ex As UnauthorizedAccessException
                Console.WriteLine(ex.Message)
                Start = Stack.Pop()
                Result.List.Add(Start)
            End Try
        Loop Until (Stack.Count = 0)
        For Each d In Result.List
            Console.WriteLine(d)
        Next
        Console.ReadLine()
        Result.Binding = New BindingSource
        Result.Binding.DataSource = Result.List_Folders
        Return Result
    End Function
#End Region

<0.2> Files

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#Region "[Enumeration] <0.2> Files"
    Public Function EnumerateFiles(Optional ByVal SearchExpression As String = "*.*",
                                         Optional ByVal SearchOption As SearchOption = SearchOption.TopDirectoryOnly) As S_Indexed
        Dim Result As New S_Indexed
        Result.List_Fichiers = New List(Of Fichier)
        Result.List = New List(Of String)
        Result.List_Image = New List(Of Bitmap)
        Dim Start As String = Target
        Result.List.Add(Start)
        Dim TempSize As Integer = 0

        Try
            Debug.WriteLine(Start)
             
            Dim files = From File In Directory.EnumerateFiles(Start, SearchExpression, SearchOption)
                        Select File
            Array.ForEach(files.ToArray(), Sub(f)
                                               Dim Fs As New Fichier(f)
                                               Result.List_Fichiers.Add(Fs)
                                               Dim M As Bitmap = Retrive_Icons.GetShellIcon(f)
                                               TempSize += Fs.Size.Raw
                                               Result.List_Image.Add(M)
                                               Result.List.Add(f)
                                           End Sub)
            Result.List.Add(Start)
        Catch ex As UnauthorizedAccessException
            Console.WriteLine(ex.Message)
            Result.List.Add(Start)
        End Try
        For Each d In Result.List
            Console.WriteLine(d)
        Next
        Console.ReadLine()
        Result.Binding = New BindingSource
        Result.Binding.DataSource = Result.List_Fichiers
        Result.Size = Convert_Size(TempSize)
        Me.Size = Convert_Size(TempSize)
        Return Result
    End Function
#End Region

<0.3> FilesSystem

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#Region "[Enumeration] <0.3> FilesSystem"
    Public Function EnumerateFilesSystem(Optional ByVal SearchExpression As String = "*.*",
                                         Optional ByVal SearchOption As SearchOption = SearchOption.TopDirectoryOnly) As S_Indexed
        Dim Result As New S_Indexed
        Result.List_Fichiers = New List(Of Fichier)
        Result.List_Folders = New List(Of Folder)
        Result.List_Image = New List(Of Bitmap)
        Dim TempSize As Integer = 0
        Result.List = New List(Of String)
        Dim Start As String = Target
        Result.List.Add(Start)
        Dim Stack As Stack(Of String) = New Stack(Of String)
        Do
            Try
                Debug.WriteLine(Start)
                Dim dirs = From d In Directory.EnumerateFileSystemEntries(Start, SearchExpression, SearchOption)
                           Select d
                Array.ForEach(dirs.ToArray(), Sub(d)
                                                  Stack.Push(d)
                                                  Dim M As Bitmap = Retrive_Icons.GetShellIcon(d)

                                                  If IO.File.Exists(d) = True Then
                                                      Dim F As New Fichier(d)
                                                      Result.List_Fichiers.Add(F)
                                                      TempSize += F.Size.Raw
                                                  Else
                                                      Dim B As New Folder(d, False, False)
                                                      Result.List_Folders.Add(B)
                                                  End If
                                                  Result.List_Image.Add(M)
                                              End Sub)
                Start = Stack.Pop
                Result.List.Add(Start)
            Catch ex As UnauthorizedAccessException
                Console.WriteLine(ex.Message)
                Start = Stack.Pop()
                Result.List.Add(Start)
            End Try
        Loop Until (Stack.Count = 0)
        For Each d In Result.List
            Console.WriteLine(d)
        Next
        Console.ReadLine()
        Result.Binding = New BindingSource
        Result.Binding.DataSource = Result.List
        Result.Size = Convert_Size(TempSize)
        Me.Size = Convert_Size(TempSize)
        Return Result
    End Function
#End Region

<0.4> Convert Size

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#Region "[Convert_Size]"
    ''' <summary>
    ''' Converts a Value into S_Size_Info
    ''' </summary>
    ''' <param name="value"></param>
    ''' <returns></returns>
    Public Function Convert_Size(ByVal value As Double) As SizeInfo
        Dim Result As SizeInfo = Nothing
        Dim EstimatedSize As ULong = value
        Result.Raw = EstimatedSize
        Dim DoubleBytes As Double = Nothing
        Dim SizeType As Int32 = -1
        Select Case EstimatedSize
            Case Is >= 1099511627776
                DoubleBytes = CDbl(EstimatedSize / 1099511627776) 'TB
                Result.Text = " To"
                Result.Valeur = FormatNumber(DoubleBytes, 2)
                Result.Display = Result.Valeur & Result.Text
                Result.Scale = Size_Scale.Terabyte
            Case 1073741824 To 1099511627775
                DoubleBytes = CDbl(EstimatedSize / 1073741824) 'GB
                Result.Text = " Go"
                Result.Valeur = FormatNumber(DoubleBytes, 2)
                Result.Display = Result.Valeur & Result.Text
                Result.Scale = Size_Scale.Gigabyte
            Case 1048576 To 1073741823
                DoubleBytes = CDbl(EstimatedSize / 1048576) 'MB
                Result.Text = " Mo"
                Result.Valeur = FormatNumber(DoubleBytes, 2)
                Result.Display = Result.Valeur & Result.Text
                Result.Scale = Size_Scale.Megabyte
            Case 1024 To 1048575
                DoubleBytes = CDbl(EstimatedSize / 1024) 'KB
                Result.Text = " Ko"
                Result.Valeur = FormatNumber(DoubleBytes, 2)
                Result.Display = Result.Valeur & Result.Text
                Result.Scale = Size_Scale.Kilobyte
            Case 0 To 1023
                DoubleBytes = EstimatedSize ' bytes
                Result.Text = " O"
                Result.Valeur = FormatNumber(DoubleBytes, 2)
                Result.Display = Result.Valeur & Result.Text
                Result.Scale = Size_Scale.Bytes
        End Select
        Return Result
    End Function 'works
Public Function GetSize() As SizeInfo
        Dim Result As New SizeInfo
        Try
            Dim fso = CreateObject("Scripting.FileSystemObject")
            Dim profile = fso.GetFolder(Target)
            Result = Convert_Size(profile.Size)

        Catch ex As Exception
            Result = Convert_Size(0)
        End Try
        Return Result
    End Function
#End Region

<0.5> Count Files

1
2
3
4
5
Public Function FileCount() As Long
        Dim fso = CreateObject("Scripting.FileSystemObject")
        Dim profile = fso.GetFolder(Target)
        Return profile.Files.Count
    End Function

Public Subs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Public Sub New()

    End Sub
    Public Sub New(ByVal Path As String, Optional ByVal Index As Boolean = False,
                   Optional ByVal Itemised As Boolean = False)
        Target = Path
        If IO.Directory.Exists(Path) Then
            DirInfo = New DirectoryInfo(Path)
        Else
            ' MsgBox("Le répertoire est vide " & Path)
        End If
        Name = IO.Path.GetFileNameWithoutExtension(Path)
        Try
            If DirInfo.Exists Then
                Exist = True
                Count_File = DirInfo.GetFiles.Count
                Count_Folder = DirInfo.GetDirectories.Count
                ' Root = New Drive_Info(Path)
                Accessed = DirInfo.LastAccessTime
                Created = DirInfo.CreationTime
                Modify = DirInfo.LastAccessTime
                If Index = True Then
                    Size = GetSize()
                    Items_File = New ListViewEx
                    For Each File As FileInfo In DirInfo.EnumerateFiles("*.*", SearchOption.TopDirectoryOnly)
                        Dim Fichier As New Fichier(File.FullName, "")
                        Dim LFile As New ListViewItem(Fichier.Name)
                        LFile.SubItems.Add(Fichier.Target)
                        Items_File.Items.Add(LFile)
                    Next
                    Items_Folder = New ListViewEx
                    For Each Dirs As DirectoryInfo In DirInfo.EnumerateDirectories("*.*", SearchOption.TopDirectoryOnly)
                        Dim LDir As New ListViewItem(Dirs.Name)
                        LDir.SubItems.Add(Dirs.FullName)
                        Items_Folder.Items.Add(LDir)
                    Next
                End If
                If Itemised = True Then
                    FolderItem = New ListViewItem(Name)
                    FolderItem.SubItems.Add(DirInfo.Extension)
                    FolderItem.SubItems.Add(Size.Display)
                    FolderItem.SubItems.Add(Accessed.ToShortDateString & ">" & Accessed.ToShortTimeString)
                    FolderItem.SubItems.Add(Modify.ToShortDateString & ">" & Modify.ToShortTimeString)
                    FolderItem.SubItems.Add(Created.ToShortDateString & ">" & Created.ToShortTimeString)
                    FolderItem.SubItems.Add(DirInfo.Parent.ToString)
                    FolderItem.SubItems.Add(Path)
                    FolderItem.SubItems.Add(IO.Path.GetPathRoot(Path))
                End If
            End If
        Catch ex As Exception

        End Try
    End Sub

23499total visits,69visits today

Share with:
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

You must be logged in to post a comment.

Telephone

+41 (079) 5111570

Postal address

Saadry Dunkel
2 avenue des Amazones
1224 Chênes-Bougeries

Contact Us




All fields are required.


Sending...

Close contact form
UA-29636309-1