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 ?? ""; roDbpath = roDbpath ?? "";
if (roDbpath == "") if (roDbpath == "")
roDbpath = @"..\ro"; roDbpath = @"..\ro";
while(roDbpath.StartsWith(@"..\")) if (roDbpath.StartsWith(@"..\"))
{ {
di2=di2.Parent; while (roDbpath.StartsWith(@"..\"))
{
di2 = di2.Parent;
roDbpath = roDbpath.Substring(3); roDbpath = roDbpath.Substring(3);
} }
DirectoryInfo [] dis = di2.GetDirectories(roDbpath); DirectoryInfo[] dis = di2.GetDirectories(roDbpath);
if (dis.Length > 0) roDbpath = dis[0].FullName; if (dis.Length > 0) roDbpath = dis[0].FullName;
}
//if (roDbpath == null || roDbpath == "") //if (roDbpath == null || roDbpath == "")
// roDbpath = fstPath.Substring(0, fstPath.LastIndexOf('\\')) + @"\ro"; // roDbpath = fstPath.Substring(0, fstPath.LastIndexOf('\\')) + @"\ro";