Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > How to read all files selected with an OpenFileDiaglog?
 

How to read all files selected with an OpenFileDiaglog?

Hi all,
I would like to get all the file selected by the users in an OPenFileDiaglog which has its multiselect property set to true.
Hopefully the file selected (e.g. abc.txt, def.txt, mnp.txt etc) can be saved in an text-string or a string array.

Can anybody shred some light on how this can be done? Thank you very much...

Tony
Tony KT Lau  Saturday, September 19, 2009 10:22 AM

OpenFileDialog openFileDialog1 = new OpenFileDialog();

// Allow the user to select multiple images.

openFileDialog1.Multiselect =

true;

openFileDialog1.Title =

"My Image Browser";

DialogResult dr = openFileDialog1.ShowDialog();

string[] fileNames = openFileDialog1.FileNames;


Please mark the post as answer if it is helpfull to you because it boosts the members to answer more and more.
  • Marked As Answer byTony KT Lau Monday, September 21, 2009 7:43 AM
  •  
_SuDhiR_  Saturday, September 19, 2009 10:49 AM

OpenFileDialog openFileDialog1 = new OpenFileDialog();

// Allow the user to select multiple images.

openFileDialog1.Multiselect =

true;

openFileDialog1.Title =

"My Image Browser";

DialogResult dr = openFileDialog1.ShowDialog();

string[] fileNames = openFileDialog1.FileNames;


Please mark the post as answer if it is helpfull to you because it boosts the members to answer more and more.
  • Marked As Answer byTony KT Lau Monday, September 21, 2009 7:43 AM
  •  
_SuDhiR_  Saturday, September 19, 2009 10:49 AM
Thank you SuDhiR...it works..
TOny
Tony KT Lau  Monday, September 21, 2009 7:43 AM

You can use google to search for other answers

Custom Search

More Threads

• Seeking Help for datagridview
• Image adding to MSSQL
• Making Fields
• BindingSource (Filter property)
• DataGridView Header Cell Not Formatting
• DataGridView and CheckBox
• InkOverlay.Renderer.Draw Method not working with dotnet obfuscator
• Print Datagrid
• Displaying an image in 2005
• Dataview Update Problems