|
|
|
If you want to add Some files in windows application you have to use open file dialog this is very useful in windows form application when we want some input as a file like images , docs etc...
here is the code for open file dialog OpenFileDialog fDialog = new OpenFileDialog(); Open Dialog Box window TitlefDialog.Title = "Open Image Files"; To apply filter, which only allows the files with the name or extension specified to be selected. in this example i m only using jpeg and GIF files onlyfDialog.Filter = "JPEG Files|*.jpeg|GIF Files|*.gif"; this is used to set initial directory which means when you open dialog box the path will be in c drive of computer.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());
}
Do you like this article it Take 5 Second to Share with your Friends
|
Subscribe Email alerts to receive more Tech Updates to your Inbox! |
|


Not Getting? Feel free to ask