Hi,
how can i find out, whether a given string specifies a Path or a file...
System.IO.File.Exist(UnknownString) does not work for my
application. i exactly need to know if the strng is a path or a file...
But how the h*** can i find it out....
Thanks in advance....
Kerem G?mr?kc?
Bruno Capuano - 11 Mar 2005 22:46 GMT
Hi ...
You can try to create the specified object to do these task.
For Example :
public bool IsFile(string Data)
{
bool ret = false;
try
{
System.IO.FileInfo f = new System.IO.FileInfo(data);
ret = true;
}
catch(Exception ex)
{}
return ret;
}
public bool IsDirectory(string Data)
{
bool ret = false;
try
{
System.IO.DirectoryInfo f = new System.IO.DirectoryInfo(data);
ret = true;
}
catch(Exception ex)
{}
return ret;
}
Regards !!
Bruno Capuano