How i verify a path is valid or not.
like C:\abc\xy.txt if the file was not there then message will show path is not exist.
Thank you.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hiren SoniPosted Jul 26, 2010, 1:15 AM
if (System.IO.Directory.Exists(path) || System.IO.File.Exists(path))
{
MessageBox.Show("true");
}
else
{
MessageBox.Show("false");
}
you can check both directory or file exists or not ?
because path man be for directory or file
Tanmay SarkarPosted Jul 26, 2010, 1:32 AM
Tanmay SarkarPosted Jul 26, 2010, 12:29 AM
But it can't tell a path is valid or not.
if i wrote C:\abc\xy.txt then your code tell the path is correct
but in real there is no that type of path in my com.
So i want to verify path is valid or not...
Thanks for your contribution & well code, :-)
but my problem is not solve yet...
Thank you!
Lalit MPosted Jul 25, 2010, 11:53 PM