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,6 +41,8 @@ namespace DataLoader
roDbpath = roDbpath ?? ""; roDbpath = roDbpath ?? "";
if (roDbpath == "") if (roDbpath == "")
roDbpath = @"..\ro"; roDbpath = @"..\ro";
if (roDbpath.StartsWith(@"..\"))
{
while (roDbpath.StartsWith(@"..\")) while (roDbpath.StartsWith(@"..\"))
{ {
di2 = di2.Parent; di2 = di2.Parent;
@ -48,6 +50,7 @@ namespace DataLoader
} }
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";