How to Embedd text files in a DLL and call specific sections of these files

Hi All , I am new in vb.net I need to know where to start to create a dll which contains named text files. and then call a section of one of these text files from the main form.
thank you in advance.
Alpenist_05Asked:
Who is Participating?
 
RobertRFreemanCommented:
Here is a link for accessing an image as an embedded resource.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbCode/html/vbtskcodeexampleretrievingimagethatisembeddedresource.asp

To apply this to your situation:
Add the text file to your project (AssemblyName) and set the Build Action property for that file in Solution Explorer/Property window to Embedded Resource.

then use the following to access the text:

Private Sub DisplayText()
    Dim sr As new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("AssemblyName.MyText.txt"))
    Dim myString as string = sr.ReadToEnd
    sr.Close()
    msgbox(myString)
End Sub
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.