Hello all:
I'm developing a C# smart device app in VS2005 for PPC2003 and above.
My program is opening a ini file at the begining which is in the same dir. Problem is that the stream code below thinks the file should be in the root "\" directory. I've tried the @".\" and the ".\\" options to try and specify the same dir as the EXE but still get a file not found exception??? When I put the file in the root "\" directory then it opens the file???
StreamReader sr = new StreamReader("temp.ini", Encoding.ASCII);
Am I missing something here?
Thank you
Marshall
Loading
Scott LyslePosted Apr 30, 2007, 2:30 PM
The full path was System.Windows.Forms.Application.StartupPath
MarshallPosted Apr 30, 2007, 7:18 AM
That works.
Thanks again!
Marshall
Huang ElitePosted Apr 29, 2007, 3:59 AM
MarshallPosted Apr 25, 2007, 7:03 AM
I cannot seem to get Application.startuppath ?
When I type Application in VS2005, I get no options for startup path???
Thank you
MarshallPosted Apr 24, 2007, 4:40 PM
Is this normal?
Seems kind of extreme just to open a file in the same dir as the EXE???
Appreciate the help!
Thank you
Scott LyslePosted Apr 24, 2007, 4:20 PM
Application.StartupPath will give you the path of the executable; you can append your file name to that.