Apologies if i post this in the wrong area.
I have written a class that parses HTML files to retreive data. This is part of the code in that class:
what I want to do is take the value of streamHTMLCode and make it a property of a class like so:
The problem is when I try to access the property in my code (yes a HTML file was loaded first), I get an error that says: Stream was not readable
Is it not possible to pass Streams or to have streams as properties of a class?
Any help would be appreciated.
I have written a class that parses HTML files to retreive data. This is part of the code in that class:
VB.NET:
Private streamHTMLCode As Stream
Dim fileReader As New WebClient()
streamHTMLCode = fileReader.OpenRead(strPath)
Dim reader As StreamReader = New StreamReader(streamHTMLCode)
Dim strHTMLCode As String = ""
Do Until reader.EndOfStream
strHTMLCode &= reader.ReadLine()
Loop
reader.Close()
what I want to do is take the value of streamHTMLCode and make it a property of a class like so:
VB.NET:
Public ReadOnly Property HTMLCode() As Stream
Get
Return streamHTMLCode
End Get
End Property
The problem is when I try to access the property in my code (yes a HTML file was loaded first), I get an error that says: Stream was not readable
Is it not possible to pass Streams or to have streams as properties of a class?
Any help would be appreciated.