-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathInputFile.vb
More file actions
executable file
·66 lines (56 loc) · 1.78 KB
/
Copy pathInputFile.vb
File metadata and controls
executable file
·66 lines (56 loc) · 1.78 KB
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
'____________________________________________________________________
'
' © Copyright 2008, brennan|marquez All rights reserved.
'____________________________________________________________________
'
' $RCSfile: InputFile.vb,v $
'
' $Revision: 1.1 $
'
' $Date: 2008/09/24 21:09:15 $
'
' $Author: thomasb $
'
' $Name: $
'____________________________________________________________________
Imports System.IO
Imports System.Text.RegularExpressions
Public Class InputFile
Private _oFileInfo As FileInfo
Private _oReadStream As FileStream
Private _oStreamReader As StreamReader
Private _sFullFilename As String
Private _sToString As String
Public Sub New(ByVal sFullFilename As String, Optional ByVal bOverwriteExisting As Boolean = True)
MyBase.New()
_sFullFilename = sFullFilename
_oFileInfo = New FileInfo(_sFullFilename)
If File.Exists(_sFullFilename) Then
_oReadStream = _oFileInfo.OpenRead
_oStreamReader = New StreamReader(_oReadStream)
_sToString = _oStreamReader.ReadToEnd
End If
End Sub
Public Overrides Function ToString() As String
Dim sReturn As String = ""
If _sToString IsNot Nothing Then
sReturn = _sToString.ToString()
End If
Return sReturn
End Function
Public Sub Close()
If _oStreamReader IsNot Nothing Then
_oStreamReader.Close()
End If
_oStreamReader = Nothing
End Sub
Protected Overrides Sub Finalize()
MyBase.Finalize()
Me.Close()
End Sub
Public ReadOnly Property FileInfo() As FileInfo
Get
Return _oFileInfo
End Get
End Property
End Class