I have created a high score file for my game and I am having problems reading it.
When I change computers my USB drive changes letter .eg from drive E to drive G.
This is causing problems with reading the file. (as I use string path = @"g:\Scores.txt";)
So my question is.... can I set a default path to the program location??
My current code:-
string path = @"g:\Scores.txt";
StringBuilder sb = new StringBuilder();
using (StreamReader sr = new StreamReader(path))
{
while (sr.Peek() >= 0)
{
sb.Append(sr.ReadLine());
}
}
any help is appreciated.