Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27248

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

$
0
0
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


Viewing all articles
Browse latest Browse all 27248

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>