Working on something in XNA, need to be able to read in data from a text file for something.
Trying to figure out how I can shorten this pathname down, so instead of it always checking there, it just checks in the directory where the actual program is.
I tried doing "\Data\Zone\"+filenamestring+".txt" as my path but it didnt work.
What I have that works:
Sub loadFromFile(ByVal fileNameString As String)
If System.IO.File.Exists("C:\Users\user\documents\visual studio 2010\Projects\asdf\asdf\asdf\Data\Zone\" + fileNameString + ".txt") Then
MsgBox("It found it.")
Else
MsgBox("Could not find it")
End If
End Sub
While this works, unfortunately this will probably only work on my machine. How do I shorten the file path so its flexible and relevant to the directory where the program is actually located at?