C#: Browsing for files

OpenFileDialog browseFileSystem = new OpenFileDialog();

browseFileSystem.InitialDirectory = @"C:\" ;
browseFileSystem.Filter = "JAD files (*.jad)|*.jad|DLL files (*.dll)|*.dll";
browseFileSystem.FilterIndex = 2 ;
browseFileSystem.RestoreDirectory = true;

if(browseFileSystem.ShowDialog() == DialogResult.OK)
{
        Selector_File.Text = browseFileSystem.FileName;
}

No comments: