I would like to know how to determine whether string is valid file path.
The file path may or may not exist.
You can simply use Path.Combine() inside a try catch statement:
string path = @" your path ";
try
{
Path.Combine(path);
}
catch
{
MessageBox.Show("Invalid path");
}
Edit: Note that this function doesn't throw an exception if path contains wildcard characters ('*' and '?') since they can be used in search strings.