I am using VS2013 Express for Desktop and using Windows Forms.
I am following this MSDN Walkthrough "Creating an Explorer Style Interface with the ListView and TreeView Controls Using the Designer". So I am trying to get the treeview to start from the "MyComputer" level, so that all the drive letters are available for the user to pick.
It works for MyDocuments, as follows:
DirectoryInfo info = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
But it doesn't work when I pick MyComputer from the autocomplete:
DirectoryInfo info = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.MyComputer));
I get:
An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll Additional information: The path is not of a legal form.
This is surprising because "MyComputer" is available in the autocomplete, but doesn't work like the other specialfolders.
Thank you.
UPDATE: Thank you ByteBlast and CodyGray.
Would it be appropriate to ask here what I should do instead?