-
May 20th, 2015, 03:53 AM
#1
Thread Starter
Junior Member
[RESOLVED] What is the best way to read from a text file?
If I make a .txt on my USB I usually have problems later on when it's time to publish the project onto a DVD. Is adding / making them with resources the best way?
-
May 20th, 2015, 04:50 AM
#2
Re: What is the best way to read from a text file?
IO.File.ReadAllLines/ReadAllText
If you find my contributions helpful then rate them.
-
May 20th, 2015, 06:26 AM
#3
Re: What is the best way to read from a text file?
If you add the text file to your project, then in its properties make sure the Build Action is set to "Content" (if you add a New Item to the project and select Text File this should be the default I believe - if you have already created it and select Add Existing Item then it might not be) and that the Copy to Output Directory is set to "Copy Always" or "Copy if newer" then part of building your application will be ensuring that the text file is in the output folder.
If you want the text file deployed elsewhere, such as the User's ApplicationData folder, that's a different matter.
-
May 20th, 2015, 06:40 AM
#4
Re: What is the best way to read from a text file?
You could also add the file as a resource, then you could read it using this...
Code:
Dim fileContent As String = My.Resources.myFileRourceName
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|