Location:Home > Turbos product range > Turbo part number > File.ReadAllLines() with resources are rejected each time.

File.ReadAllLines() with resources are rejected each time.

Time:2018-06-20 22:24Turbochargers information Click:

Resources files Resource Ap

Feb 19th, 2013, 10:54 AM

davebold370

Thread Starter

Junior Member Join Date   Oct 2012   Posts   17  

File.ReadAllLines() with resources are rejected each time.

So, Here is the question I have.
Why does, file located in stated area, work: File.ReadAllLines(AppPath & "\filename.txt")
While this one, files uploaded into resource and saved then restarted, File.ReadAllLines(My.Resources.filename) doesn't?
The files are in the correct locations. The resource is in the resource folder using the VB.net system and the appPath files are in the appPath be a copy and paste.

The error is the resources has illegal characters in the path name. What could be causing this problem?

Code:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim appPath As String = My.Application.Info.DirectoryPath.ToString() Dim reVeadAsString As String() = IO.File.ReadAllLines(My.Resources.vead) RichTextBox1.Text = reVeadAsString(15) End Sub

Reply With Quote

Reply With Quote

Feb 19th, 2013, 10:59 AM

stanav

PowerPoster

stanav's Avatar

Join Date   Jul 2006   Location   Providence, RI - USA   Posts   9,292  

Re: File.ReadAllLines() with resources are rejected each time.

What kind of file is embedded in My.Resources.vead?

Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -

Reply With Quote

Reply With Quote

Feb 19th, 2013, 11:00 AM

davebold370

Thread Starter

Junior Member Join Date   Oct 2012   Posts   17  

Re: File.ReadAllLines() with resources are rejected each time.

@Stanav basic text files with lists of words.

Copyright infringement? Click Here!