RSS 2.0 | Atom 1.0 | CDF

Search

Categories

Archive

Blogroll

Sign In

# Monday, May 24, 2004
Monday, May 24, 2004 12:34:15 PM (GMT Daylight Time, UTC+01:00) ( .Net Windows Forms )

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.

Comments [1] | | # 
Sunday, January 02, 2005 10:12:00 PM (GMT Standard Time, UTC+00:00)
Yeah, oddly, Environment.SpecialFolders didn't appear in IntelliSense for me either, but it compiles just fine. Very weird. Posts in other forums seem to indicate this might be a bug with IntelliSense.

- David Stein
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview