OpenFileDialog fDialog = new OpenFileDialog();
fDialog.Title = "Open Image Files";
only allows the files with the name or extension only using jpeg and GIF files
fDialog.Filter = "JPEG Files|*.jpeg|GIF Files|*.gif";
To set the Initial Directory property ,means which directory to show when the open file dialog windows opens
fDialog.InitialDirectory = @"C:\";
if the user has clicked the OK button after choosing a file,To display a MessageBox with the path of the file:
if(fDialog.ShowDialog() == DialogResult.OK)
{
MessageBox.Show(fDialog.FileName.ToString());
}
vijay.k
Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator