Wednesday, June 29, 2005

WinForm applications StartUp Path:
No more talk, time has come now to code: let's start somewhere: anywhere in fact in this large world of multi - purpose development. Well I was working on an Office automation stuff. Having a word document repository folder in my .Net solution Folder let's say FolderA, and knowing that at execution time I'll be located into the FolderA\bin\Debug directory I supposed I could use something like @"..\..\doc" to get into the FolderA\docs directory. Why didn't it work ? I 'll know one day.But when your are coding on projects you don't have time to think a lot, you just have time to make things work as expected. So I didn't wait anymore : I used Application.StartupPath function, mixed it with something like Application.StartupPath.Substring(0, Application.StartupPath.Length-9) + "doc" and I could get the result.
I will come back later to my "Zen of code Optimisation" book and see if something there would help me fastening the code in this cow world of >2 Ghz speed processors

0 Comments:

Post a Comment

<< Home