Fixed relative location logic to work with absolute locations

This commit is contained in:
Rich 2012-07-26 14:15:15 +00:00
parent dbdb1d6f7d
commit 46385cfa07

View File

@ -41,13 +41,16 @@ namespace DataLoader
roDbpath = roDbpath ?? "";
if (roDbpath == "")
roDbpath = @"..\ro";
while(roDbpath.StartsWith(@"..\"))
if (roDbpath.StartsWith(@"..\"))
{
di2=di2.Parent;
roDbpath = roDbpath.Substring(3);
while (roDbpath.StartsWith(@"..\"))
{
di2 = di2.Parent;
roDbpath = roDbpath.Substring(3);
}
DirectoryInfo[] dis = di2.GetDirectories(roDbpath);
if (dis.Length > 0) roDbpath = dis[0].FullName;
}
DirectoryInfo [] dis = di2.GetDirectories(roDbpath);
if (dis.Length > 0) roDbpath = dis[0].FullName;
//if (roDbpath == null || roDbpath == "")
// roDbpath = fstPath.Substring(0, fstPath.LastIndexOf('\\')) + @"\ro";