|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
embedded text fileHi
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. Peter van der veen wrote: Show quoteHide quote > 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 <Peter van der veen> schrieb:
> 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() /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
.NET Remoting & RTD
WebRequest.Create drawing a rectangle in a form VB.NET Progress Bar - Recursive Search DataGridView visible columns Fill in textboxes programatically in ASPX Access of shared member, constant member, enum member or nested type through an instance Two threads are accessing my Synclocked code Treeview PopMenu vs ContextMenu |
|||||||||||||||||||||||