public void CopyRW() { conf Config = new conf(); try { File.Copy(pdfName, Config.outPath + "Rok_20" + year + "\\RW\\" + docName + ".pdf"); StreamWriter RW; RW = File.AppendText(fileLog); RW.WriteLine(Config.outPath + "Rok_20" + year + "\\RW\\" + docName + ".pdf"); RW.Close(); } catch (IOException) { FileInfo infoFirst = new FileInfo(Config.outPath + "Rok_20" + year + "\\RW\\" + docName + ".pdf"); long byteFirst = infoFirst.Length; FileInfo infoSecond = new FileInfo(pdfName); long byteSecond = infoSecond.Length; if (byteFirst != byteSecond) { File.Copy(pdfName, Config.outPath + "Rok_20" + year + "\\duplikaty\\" + docName + ".pdf"); StreamWriter RW2; RW2 = File.AppendText(fileLog); RW2.WriteLine("!! DUPLIKAT !! " + Config.outPath + "Rok_20" + year + "\\duplikaty\\" + docName + ".pdf" + " !! DUPLIKAT !!"); RW2.Close(); } else { StreamWriter RW3; RW3 = File.AppendText(fileLog); RW3.WriteLine("!! Identyczny plik istnieje !! " + Config.outPath + "Rok_20" + year + "\\" + docName + ".pdf" + " !! Identyczny plik istnieje !!"); RW3.Close(); } } }
public void CopyOther() { conf Config = new conf(); File.Copy(pdfName, Config.inPath + "\\!do_przetworzenia_recznego\\" + docName); StreamWriter RW; RW = File.AppendText(fileLog); RW.WriteLine(Config.inPath + "\\!do_przetworzenia_recznego\\" + docName); RW.Close(); }