embedded text file

  • Thread starter Thread starter Peter van der veen
  • Start date Start date
P

Peter van der veen

Hi

I have a VB project and added a text file to it as an embedded
resource.

But i can'f find a way now how to read this file just as a normal text
file with the streamreader command.

Anyone can give me a hint?

Peter
 
Stream resStream =
Assembly.GetExecutingAssembly().GetManifestResourceStream(this.GetType(),
fileName)

Remember to close the stream.
 
I have a VB project and added a text file to it as an embedded
resource.

But i can'f find a way now how to read this file just as a normal text
file with the streamreader command.

\\\
Imports System.IO
..
..
..
Dim f As Stream =
System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream( _
"<Name of the root namespace>.test.txt" _
)
Dim st As New StreamReader(f)
MsgBox(st.ReadToEnd())
st.Close()
///
 
Back
Top