File Open Dialog Question
-
I have a file open dialog that I use to pick files from two different directories. I am trying to remember the directory so that the user doesn't have to switch directories often. This code below only remembers the last directory open. The initial directory function doesn't seem to work. I have tried RestoreDirectory function as both true and false. It also doesn't seem to work. Any ideas as to what I am doing wrong? The code snippet
Stream myStream; string pickedFile = ""; openFileDialog.Title = "Locate Tranlator Directory"; openFileDialog.Filter = "Fanuc Translators (*.exe)|*.exe|All files (*.*)|*.*" ; if(!Directory.Exists(transDir)) { transDir = ""; } openFileDialog.FilterIndex = 1 ; openFileDialog.RestoreDirectory = false ; openFileDialog.InitialDirectory = transDir; if(openFileDialog.ShowDialog() == DialogResult.OK) { if((myStream = openFileDialog.OpenFile())!= null) { pickedFile = openFileDialog.FileName.ToString(); transDir = Path.GetDirectoryName(pickedFile); } } /code> Jeff Patterson Programmers speak in Code. [http://www.anti-dmca.org](http://www.anti-dmca.org)[[^](http://www.anti-dmca.org "New Window")]