| |
Sign In
I was using an OpenFileDialog and i wanted it to open at the My Pictures folder for the current user. So i looked up the msdn docs for how to locate this folder, and i come across the Environment.SpecialFolder enumeration, which has an entry for MyPictures. Great, my code then was:
this.openFileDialog1.InitialDirectory = Environment.SpecialFolder.MyPictures;
but this didn't compile, and it didn't show up in Intellisense. I read a few examples online which used the following syntax:
this.openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
and it worked, although it still didn't show up in Intellisense. you'd think MS would at least explain this in the docs, weird.
Remember Me