Hi everybody
I have a .txt file in the same folder as my project that is being loaded into an array. I want to get rid of the .txt file and import it into the .exe. So I used the import resources and put it in the text file section of the project. When I use my.resources.lvlxp it gives me an error that there are illegal characters in the path.
Here is the code for loading from the .txt in the folder:
and the code for loading from my.resources:Code:Dim tempstr As String Dim x As Integer = 1 Dim firstcomma As Integer Dim filenum As Integer = FreeFile() FileOpen(filenum, "lvlxp.txt", OpenMode.Input) Do While Not EOF(1) tempstr = LineInput(filenum) firstcomma = tempstr.IndexOf(",") lvlarray(x) = tempstr.Substring(0, firstcomma) xparray(x) = tempstr.Substring(lvlarray(x).ToString.Length + 1, tempstr.Length - lvlarray(x).ToString.Length - 1) x += 1 Loop FileClose(1)
This is my first time using my.resources and am still pretty new to VB itself..Code:Dim tempstr As String Dim x As Integer = 1 Dim firstcomma As Integer Dim filenum As Integer = FreeFile() FileOpen(filenum, My.resources.lvlxp, OpenMode.Input) Do While Not EOF(1) tempstr = LineInput(filenum) firstcomma = tempstr.IndexOf(",") lvlarray(x) = tempstr.Substring(0, firstcomma) xparray(x) = tempstr.Substring(lvlarray(x).ToString.Length + 1, tempstr.Length - lvlarray(x).ToString.Length - 1) x += 1 Loop FileClose(1)
Thanks for any and all help.![]()




Reply With Quote