Is there a way for a open file dialog to use the "My Computer" instead of a specific path. In this example, the W: drive is the intial directory.
Dim dlgOpen As New Microsoft.Win32.OpenFileDialog
dlgOpen.Filter = "Bases de données Access(*.mdb)|*.mdb"
dlgOpen.InitialDirectory = "W:"
I figure there must be a value or function that return the My Computer path, but what is it?
Thank you
My Computer is a virtual folder. It has a predefined GUID. Here is how you get My Computer
OpenFileDialog d = new OpenFileDialog();
d.InitialDirectory = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
d.ShowDialog();
If you want to know about special folders
http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx
but be aware of
The MyComputer constant always yields the empty string ("") because no path is defined for the My Computer folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With