C
C# newbie
Hello,
using openfiledialog, how can I retrieve the path ?
thx
using openfiledialog, how can I retrieve the path ?
thx
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hello,
using openfiledialog, how can I retrieve the path ?
thx
Thanks. The thing is I'm useing the path either but compiler complains on
path!
Any suggestions ?
Regards
Hi Ludwig,
Thanks for your quick response. Regarding your code :
OpenFileDialog o = new OpenFileDialog();
if (o.ShowDialog() == DialogResult.OK)
{
string fn = Path.GetFileName(o.FileName);
string path = Path.GetDirectoryName(o.FileName);
}
the compiler complains about "Path". Also, after adding a dot to "Path"
Intellisence does't come upand doesn't show any method related. I was
assuming that Path is a member of the OpenFileDialog class.
Any idea?
L# said:No, Path is a System.IO class, so use System.IO.Path, or put "using
System.IO;" on top.
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.