How to get the filename of openFileDialog

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I use the codes below to get the filename of openFileDialog, but it always
return a null.
How can I get he filename of openFileDialog?

************************************************************************
if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
string sFileName=openFileDialog1.FileName;
.......
}
************************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top