From ab65d5acbae48aa66b500d71602f272e7e1f1168 Mon Sep 17 00:00:00 2001 From: tsuji Date: Wed, 1 Dec 2021 15:08:46 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=BBFile.Move=E3=82=92File.Copy=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=88=E5=88=A5=E3=83=89=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=96=E3=81=AB=E7=A7=BB=E5=8B=95=E3=81=A7=E3=81=8D=E3=81=AA?= =?UTF-8?q?=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E5=9B=9E=E9=81=BF=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=9F=E3=82=81=EF=BC=89=20=E3=83=BBlog=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=81=AE=E6=9C=80=E5=BE=8C=E3=81=AB=E6=A4=9C=E7=89=88?= =?UTF-8?q?=E3=83=AC=E3=83=9D=E3=83=BC=E3=83=88=E3=81=AEpath=E3=82=92?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E6=94=B9=E8=89=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/CSRender/CSRender/CompareTIFF.cs | 15 +++++++++++++-- Code/CSRender/CSRender/MainWindow.xaml.cs | 9 +++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Code/CSRender/CSRender/CompareTIFF.cs b/Code/CSRender/CSRender/CompareTIFF.cs index 459a72a..6443997 100644 --- a/Code/CSRender/CSRender/CompareTIFF.cs +++ b/Code/CSRender/CSRender/CompareTIFF.cs @@ -100,9 +100,20 @@ namespace CSRender , "*", SearchOption.TopDirectoryOnly);//reportフォルダ内の全てのファイルを取得 foreach (string file in allReport) { - string fileTarget = System.IO.Path.GetFileName(file); - File.Move(file, System.IO.Path.Combine(reportPath, fileTarget));//指定先に移動 + string fileTarget = System.IO.Path.Combine(reportPath, System.IO.Path.GetFileName(file));//旧パスからファイル名を取得して新しいパスを作成 + File.Copy(file, fileTarget, true);//指定先にコピー + File.Delete(file);//コピー元のファイルを削除 } } + + //検版レポートのファイル名を取得 + public static string getReportName(string workPath) + { + string[] reportFilePath = System.IO.Directory.GetFiles(System.IO.Path.Combine(workPath, "report") + , "*.pdf", System.IO.SearchOption.TopDirectoryOnly);//レポートファイルのパスを取得 + string ReportName = System.IO.Path.GetFileName(reportFilePath[0]);//file名を抽出 + + return ReportName; + } } } diff --git a/Code/CSRender/CSRender/MainWindow.xaml.cs b/Code/CSRender/CSRender/MainWindow.xaml.cs index 3838a17..321397e 100644 --- a/Code/CSRender/CSRender/MainWindow.xaml.cs +++ b/Code/CSRender/CSRender/MainWindow.xaml.cs @@ -202,9 +202,16 @@ namespace CSRender //レポートを出力 outputLog(System.IO.Path.Combine(workDir, "report")); + string PDFName = CompareTIFF.getReportName(workDir); + //指定先にレポートを移動 CompareTIFF.moveReport(workBox.Text, workDir); + //レポートのパスを表示 + ResultConsole.Text += " 検版レポートのパス:"; + ResultConsole.Text += System.IO.Path.Combine(workBox.Text, "report", PDFName); + ResultConsole.Text += "\r\n"; + //パラメータを次回初期値用に保存 Properties.Settings.Default.resolutionSetting = ResolutionBox.Text; Properties.Settings.Default.formatSetting = FileSelect.Text; @@ -295,6 +302,7 @@ namespace CSRender Properties.Settings.Default.Save(); } + //メニュを明示的に更新する private void DoEvents() { DispatcherFrame frame = new DispatcherFrame(); @@ -303,6 +311,7 @@ namespace CSRender Dispatcher.PushFrame(frame); } + //実行中のオブジェクトを読み込み private object ExitFrames(object obj) { ((DispatcherFrame)obj).Continue = false; -- 2.22.0