473,395 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

OpenFileDialog: MyComputer

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.
Sep 7 '06 #1
3 9848
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.

Sep 8 '06 #2
Stoitcho Goutsev (100) schrieb:
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}
Thanks for your help!
Sep 8 '06 #3
On Fri, 8 Sep 2006 11:21:56 -0400, "Stoitcho Goutsev \(100\)" <10*@100.com>
wrote:
>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}
Stoitcho,

This is a bit off topic, but perhaps you know the answer to this one also:

In XP it annoys me that the MyDocuments folder is at the top of the folder list
when I open the File Browser. Is there a way to make it appear at the bottom of
the list?

Thanks,
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Sep 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: C# newbie | last post by:
Hello, using openfiledialog, how can I retrieve the path ? thx
3
by: bobrad | last post by:
MAYBE SOMEBODY CAM HELP I AM USING THE FOLLOWING CODE TO GET A LOCATION OF A FILE IN A WINFORM DIALOG OpenFileDialog openFileDialog = new OpenFileDialog(); OpenFileDialog.Filter = " Access...
4
by: Nagachandra Sekhar Grandhi | last post by:
I am facing a problem with OpenFileDialog. It is as follows. I opened OpenFileDialog dialog box and selected a folder in it. After selecting the folder when i tried to delete the same folder in...
8
by: e-mid | last post by:
why does not openFileDialog have closed event? i want to do something; as soon as the dialog closes. is there a way to do this?
4
by: trouling | last post by:
An aspx page I made with a DataGrid and SQLConnection to my local MS SQL server shows appropriate DB information when view from within the ..NET designer. However, when selecting: "View in...
6
by: barbara_dave | last post by:
Hi, All, I want to use the openfiledialog to open different extension files in different directory( only one type files at one time). I set the OpenFiledialog InitialDirectory and Filter...
8
by: marcus.kwok | last post by:
I am having a weird problem and I have can't figure out why it is happening. I create an OpenFileDialog and set a filename filter. When the dialog first opens, the filter works correctly, and...
3
by: PiotrKolodziej | last post by:
Hi I have a problem. When i enter MyComputer via openfiledialog, i cant see any drives, to change, and generally window is open. Thanks for any help.
8
by: Steve Marshall | last post by:
Hi All, Is it possible to set the InitialDirectory property of an OpenFileDialog so it will open at the "My Computer" level? I want it to open showing all the available drives. If so, what do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.