From 2c076b1f0a07e3aeb9ad40f9eae2caf2ea51fb1d Mon Sep 17 00:00:00 2001 From: MerrickZ Date: Mon, 14 Aug 2023 12:19:50 +0800 Subject: [PATCH] Hide Window;Provide MessageBox Alert --- ofd2pdf/ofd2pdf/Program.cs | 8 ++++++-- ofd2pdf/ofd2pdf/Properties/AssemblyInfo.cs | 4 ++-- ofd2pdf/ofd2pdf/ofd2pdf.csproj | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ofd2pdf/ofd2pdf/Program.cs b/ofd2pdf/ofd2pdf/Program.cs index 3b82a2b..b032b80 100644 --- a/ofd2pdf/ofd2pdf/Program.cs +++ b/ofd2pdf/ofd2pdf/Program.cs @@ -1,5 +1,6 @@ using Spire.Pdf.Conversion; using System; +using System.Windows.Forms; namespace ofd2pdf { @@ -11,6 +12,7 @@ static void Main(string[] args) { Console.WriteLine("OFD TO PDF 转换工具"); Console.WriteLine("使用方式: ofd2pdf.exe "); + MessageBox.Show("使用方式: ofd2pdf.exe ,或者配置为OFD文件打开方式", "OFD TO PDF 转换工具"); } else { @@ -19,12 +21,14 @@ static void Main(string[] args) { Console.WriteLine($"#转换 {ofdfile}"); OfdConverter oc = new OfdConverter(ofdfile); - oc.ToPdf(ofdfile+".pdf"); + string newFilename = ofdfile.Replace(".ofd", ".pdf"); + oc.ToPdf(newFilename); Console.WriteLine($"#完成 {ofdfile}"); + } else { - Console.WriteLine($"{ofdfile} 不是OFD文件"); + MessageBox.Show($"{ofdfile} 不是OFD文件", "OFD TO PDF 转换工具"); } } } diff --git a/ofd2pdf/ofd2pdf/Properties/AssemblyInfo.cs b/ofd2pdf/ofd2pdf/Properties/AssemblyInfo.cs index 550bae1..7964837 100644 --- a/ofd2pdf/ofd2pdf/Properties/AssemblyInfo.cs +++ b/ofd2pdf/ofd2pdf/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/ofd2pdf/ofd2pdf/ofd2pdf.csproj b/ofd2pdf/ofd2pdf/ofd2pdf.csproj index 28b808c..1192a05 100644 --- a/ofd2pdf/ofd2pdf/ofd2pdf.csproj +++ b/ofd2pdf/ofd2pdf/ofd2pdf.csproj @@ -5,7 +5,7 @@ Debug AnyCPU {63FF36CB-2399-4510-BC4C-3F3E06B68C95} - Exe + WinExe ofd2pdf ofd2pdf v4.7.2 @@ -79,6 +79,7 @@ +