public List <TmpSave> HostToDatePath(Hostlocate locate) { string hostpath = PublicMethod.pathhead(locate); List <TmpSave> tmpTable = new List <TmpSave>(); DateRange.ForEach((x) => { string fullpath = hostpath + PublicMethod.pathdate(x); if (Directory.Exists(fullpath)) { tmpTable.AddRange(FileToTmptable(locate.hostname, fullpath, x)); } }); return(tmpTable); }
public void AddDiffDBFile(EMRN emrn, Hostlocate host, string type) { DateTime transdate = DateTime.ParseExact(emrn.TransNo.Substring(1, 8), "yyyyMMdd", null); string hostpath = PublicMethod.pathhead(host) + PublicMethod.pathdate(transdate); string Filename = @"\" + type; Compair_DIFF tmpdiff = new Compair_DIFF(); if (!IOhelper.FileExists(hostpath + Filename)) { tmpdiff.Datetime = transdate; tmpdiff.Filename = Filename; tmpdiff.FilePath = hostpath + Filename; tmpdiff.Hostname = host.hostname; tmpdiff.Note = "比對TransNo缺少檔案"; difflist.Add(tmpdiff); } }
public void CheckFile(EMRN emrn, Hostlocate locate) { DateTime transdate; string hostpath; string Plaintext; string Signature; string TimeStamp; transdate = DateTime.ParseExact(emrn.TransNo.Substring(1, 8), "yyyyMMdd", null); hostpath = PublicMethod.pathhead(locate) + PublicMethod.pathdate(transdate); Plaintext = @"\" + emrn.TransNo + "_PlainText.dat"; Signature = @"\" + emrn.TransNo + "_Signature.dat"; TimeStamp = @"\" + emrn.TransNo + "_TimeStamp.dat"; AddDiffDBFile(emrn, locate, Plaintext); AddDiffDBFile(emrn, locate, Signature); AddDiffDBFile(emrn, locate, TimeStamp); }
public static string pathhead(Hostlocate locate) { return(@"\\" + locate.hostname.Trim() + @"\" + locate.path.Replace(':', '$').Trim()); }