Mike,
MyComputer is not a phisical folder on the disk that's why
Environment.GetFolderPath returns an empty string. This btw is documented
behavior. Folders such MyComputer are called virtual folders and they have
pre-defined GUIDs that OpenFileDialog can open them.
Try this:
openFileDialog.InitialDirectory =
"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
Other special folder GUIDs are:
MyComputer - ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
MyDocuments - ::{450D8FBA-AD25-11D0-98A8-0800361B1103}
MyNetworkPlaces - ::{208D2C60-3AEA-1069-A2D7-08002B30309D}
Printers - ::{2227A280-3AEA-1069-A2DE-08002B30309D}
RecycleBin = ::{645FF040-5081-101B-9F08-00AA002F954E}
--
HTH
Stoitcho Goutsev (100)
"Mike Wesling" <gl***************@web.dewrote in message
news:ed*************@news.t-online.com...
Hi,
does anyone know how to show the OpenFileDialog with "My Computer" as
InitialDirectory?
I tried it with
openFileDialog.InitialDirectory =
Environment.GetFolderPath(Environment.SpecialFolde r.MyComputer);
but it didn't work, unfortunately.