Click to See Complete Forum and Search --> : How to manager opendialog ?


tom_codon
March 24th, 2009, 07:01 PM
Hi all...!
I'm working with OpenFileDialog and just have a question.
Some on here know how to manager OpenFileDialog autostart to Dir "\ProgramData\Microsoft\Windows\Start Menu\Programs" of Windows hard disk ?
Please tell me how to do it

Thanks a lot..!

BigEd781
March 24th, 2009, 07:16 PM
Set the InitialDirectory property. MSDN is your friend ;)

STLDude
March 24th, 2009, 07:19 PM
Have you read the docs? In case your Google foo is week here (http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.initialdirectory(VS.85).aspx) is a direct link to appropriate field you need to set.

tom_codon
March 24th, 2009, 07:46 PM
Thanks BigEd781,STLDude for answer.!
I already read it but in my computer windows system in H: Disk , other computer in C: , D: ....
So how i can manager it to right Windows disk ?

My computer now , files i need in "H:\ProgramData\Microsoft\Windows\Start Menu\Programs"
I can set it , but other ?

How can set it always go to "\ProgramData\Microsoft\Windows\Start Menu\Programs" on Windows disk ?

Thanks again..!

STLDude
March 24th, 2009, 08:24 PM
You do need to get your Google foo in order, all this information is readily available. Here (http://msdn.microsoft.com/en-us/library/bb762188(VS.85).aspx) it's a start and this (http://msdn.microsoft.com/en-us/library/bb762584(VS.85).aspx) page lists all possible Folders you can get path to it.

tom_codon
March 25th, 2009, 03:07 AM
Problem sloved!

here my code :

string sResult = "";
string sStatup = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\Microsoft\Windows\Start Menu\Programs";

OpenFileDialog filedlg = new OpenFileDialog();
filedlg.InitialDirectory = sStatup;
if (filedlg.ShowDialog() == DialogResult.OK)
sResult = filedlg.FileName;

Again thanks BigEd781,STLDude for help!

Tom.