private string getBestFullFilename(string fullFilename)
{
if (fullFilename == null)
return string.Empty;
else if (fullFilename.Trim().Length == 0)
return string.Empty;
string pth = fullFilename;
FileInfo fi = new FileInfo(pth);
if (!fi.Exists)
{
DirectoryInfo di = fi.Directory;
while (!di.Exists)
{
di = di.Parent;
if (di == null)
break;
}
if (di != null)
pth = di.FullName;
else
pth = string.Empty;
pth = Path.Combine(pth, fi.Name);
}
return pth;
}