C
C# newbie
Hello,
using openfiledialog, how can I retrieve the path ?
thx
using openfiledialog, how can I retrieve the path ?
thx
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.