Tuesday, November 23, 2004

Raymond Chen explains why folders like My Pictures would reappear after you delete them.

There's actually something that caught me by surprise in .NET that I learned to accept that is along the same lines. I have some code that needs to look for a file in the Application Data folder area for a particular program. But I don't want to use the CommonAppDataPath, as this creates a new folder for each version of the application. Therefore, I use the GetParent function combined with the folder name I always want to use like this:

dirStore = System.IO.Directory.GetParent(System.Windows.Forms.Application.CommonAppDataPath).ToString & "\filestore"

But this actually creates the CommAppDataPath folder anyway! Maybe there's an overload I'm missing and I learned to accept it. My data goes where I want it to in the long run and the users never look there anyway.

 



Posted from BLInk!
Tuesday, November 23, 2004 10:31:07 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  |