Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Friend Class Tree
- Friend Root As Directory
- Friend NumFiles As Integer
- Friend NoDirectory As Boolean
- End Class
- Friend MustInherit Class FileObject
- Protected m_list As New List(Of FileObject)
- Private m_Name As String
- Private m_FullName As String
- Public Property Name As String
- Get
- Return m_name
- End Get
- Set(ByVal value As String)
- m_name = value
- End Set
- End Property
- Public Property FullName As String
- Get
- Return m_FullName
- End Get
- Set(ByVal value As String)
- m_FullName = value
- End Set
- End Property
- End Class
- Friend Class File
- Inherits FileObject
- Private m_len As ULong
- Public ReadOnly Property Len As ULong
- Get
- Return m_len
- End Get
- End Property
- Public Sub New(ByVal FullName As String)
- If IO.File.Exists(FullName) Then
- Dim File As New IO.FileInfo(FullName)
- Me.Name = File.Name
- Me.FullName = FullName
- m_len = File.Length
- Else
- Throw New Exception(FullName & " is not a file")
- End If
- End Sub
- End Class
- Friend Class Directory
- Inherits FileObject
- Public Sub New(ByVal FullName As String)
- If IO.Directory.Exists(FullName) Then
- Dim File As New IO.FileInfo(FullName)
- Me.Name = File.Name
- Me.FullName = FullName
- Else
- Throw New Exception(FullName & " is not a file")
- End If
- End Sub
- Public ReadOnly Property Items As List(Of FileObject)
- Get
- Return m_list
- End Get
- End Property
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement