From ffeffca95297f38cee3ca899cf872110a41a5cec Mon Sep 17 00:00:00 2001 From: zmjack Date: Thu, 13 Jun 2024 19:39:58 +0800 Subject: [PATCH] PortProxyGUI.1.4.2 --- PortProxyGUI/About.cs | 5 +---- PortProxyGUI/Data/Rule.cs | 5 +++++ PortProxyGUI/PortProxyGUI.cs | 2 -- PortProxyGUI/PortProxyGUI.csproj | 6 +++--- PortProxyGUI/Program.cs | 4 +++- PortProxyGUI/SetProxy.cs | 1 - PortProxyGUI/Utils/InterfaceUtil.cs | 15 --------------- PortProxyGUI/publish.ps1 | 21 +++++++++++++++++++++ README.md | 7 +++++-- 9 files changed, 38 insertions(+), 28 deletions(-) delete mode 100644 PortProxyGUI/Utils/InterfaceUtil.cs create mode 100644 PortProxyGUI/publish.ps1 diff --git a/PortProxyGUI/About.cs b/PortProxyGUI/About.cs index f2c3cd7..77a0f35 100644 --- a/PortProxyGUI/About.cs +++ b/PortProxyGUI/About.cs @@ -1,5 +1,4 @@ -using PortProxyGUI.Utils; -using System; +using System; using System.Diagnostics; using System.Windows.Forms; @@ -14,8 +13,6 @@ namespace PortProxyGUI PortProxyGUI = portProxyGUI; InitializeComponent(); - Font = InterfaceUtil.UiFont; - label_version.Text = label_version.Text + " v" + Application.ProductVersion; } diff --git a/PortProxyGUI/Data/Rule.cs b/PortProxyGUI/Data/Rule.cs index 9e0d491..55a62d1 100644 --- a/PortProxyGUI/Data/Rule.cs +++ b/PortProxyGUI/Data/Rule.cs @@ -36,6 +36,11 @@ namespace PortProxyGUI.Data set => _realConnectPort = value; } + public override int GetHashCode() + { + return base.GetHashCode(); + } + public bool Equals(Rule other) { return Id == other.Id diff --git a/PortProxyGUI/PortProxyGUI.cs b/PortProxyGUI/PortProxyGUI.cs index eea743b..485eda2 100644 --- a/PortProxyGUI/PortProxyGUI.cs +++ b/PortProxyGUI/PortProxyGUI.cs @@ -22,8 +22,6 @@ namespace PortProxyGUI public PortProxyGUI() { InitializeComponent(); - Font = InterfaceUtil.UiFont; - listViewProxies.ListViewItemSorter = lvwColumnSorter; } diff --git a/PortProxyGUI/PortProxyGUI.csproj b/PortProxyGUI/PortProxyGUI.csproj index fda4406..dd0a56f 100644 --- a/PortProxyGUI/PortProxyGUI.csproj +++ b/PortProxyGUI/PortProxyGUI.csproj @@ -2,7 +2,7 @@ WinExe - net6.0-windows;net35;net451 + net8.0-windows;net6.0-windows;net35;net451 true app.manifest zmjack @@ -14,9 +14,9 @@ portproxy TCP/IP redirector LICENSE.md Copyright © nstandard.net 2020 - 1.4.1 + 1.4.2 icon.ico - Microsoft Sans Serif, 8pt + Arial, 8.25pt PPGUI preview diff --git a/PortProxyGUI/Program.cs b/PortProxyGUI/Program.cs index 0cfff63..1c8304e 100644 --- a/PortProxyGUI/Program.cs +++ b/PortProxyGUI/Program.cs @@ -23,9 +23,10 @@ namespace PortProxyGUI { // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. + #if NET6_0_OR_GREATER ApplicationConfiguration.Initialize(); -#elif NETCOREAPP3_1_OR_GREATER +#elif NETCOREAPP3_1_OR_GREATER Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); @@ -33,6 +34,7 @@ namespace PortProxyGUI Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); #endif + Application.Run(new PortProxyGUI()); } } diff --git a/PortProxyGUI/SetProxy.cs b/PortProxyGUI/SetProxy.cs index c69f456..4132d45 100644 --- a/PortProxyGUI/SetProxy.cs +++ b/PortProxyGUI/SetProxy.cs @@ -22,7 +22,6 @@ namespace PortProxyGUI ParentWindow = parent; InitializeComponent(); - Font = InterfaceUtil.UiFont; AutoTypeString = comboBox_Type.Text = comboBox_Type.Items.OfType().First(); var groupNames = ( diff --git a/PortProxyGUI/Utils/InterfaceUtil.cs b/PortProxyGUI/Utils/InterfaceUtil.cs deleted file mode 100644 index d0b0c3b..0000000 --- a/PortProxyGUI/Utils/InterfaceUtil.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Drawing; - -namespace PortProxyGUI.Utils -{ - public class InterfaceUtil - { - /// - /// Compatibility between .NET Framework and .NET Core. - /// - /// - public static readonly Font UiFont = new(new FontFamily("Microsoft Sans Serif"), 8f); - - } -} - diff --git a/PortProxyGUI/publish.ps1 b/PortProxyGUI/publish.ps1 new file mode 100644 index 0000000..3b24cd2 --- /dev/null +++ b/PortProxyGUI/publish.ps1 @@ -0,0 +1,21 @@ +Remove-Item -Path ".\bin\publish" -Recurse + +dotnet publish -c Release -f "net8.0-windows" /p:PublishProfile="net8-x64" +dotnet publish -c Release -f "net8.0-windows" /p:PublishProfile="net8-x86" + +dotnet publish -c Release -f "net6.0-windows" /p:PublishProfile="net6-x64" +dotnet publish -c Release -f "net6.0-windows" /p:PublishProfile="net6-x86" + +Copy-Item -Path ".\bin\Release\net451\" ".\bin\Publish\" -Recurse -Force +Copy-Item -Path ".\bin\Release\net35\" ".\bin\Publish\" -Recurse -Force + +$ver = "1.4.2" + +Compress-Archive -Path ".\bin\publish\net8-x64\*" -DestinationPath ".\bin\publish\ppgui-net8-x64-$ver.zip" -Force +Compress-Archive -Path ".\bin\publish\net8-x86\*" -DestinationPath ".\bin\publish\ppgui-net8-x86-$ver.zip" -Force + +Compress-Archive -Path ".\bin\publish\net6-x64\*" -DestinationPath ".\bin\publish\ppgui-net6-x64-$ver.zip" -Force +Compress-Archive -Path ".\bin\publish\net6-x86\*" -DestinationPath ".\bin\publish\ppgui-net6-x86-$ver.zip" -Force + +Compress-Archive -Path ".\bin\publish\net451\*" -DestinationPath ".\bin\publish\ppgui-net451-$ver.zip" -Force +Compress-Archive -Path ".\bin\publish\net35\*" -DestinationPath ".\bin\publish\ppgui-net35-$ver.zip" -Force diff --git a/README.md b/README.md index 58cd0df..5479545 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,12 @@ A manager for netsh interface portproxy, which is to evaluate TCP/IP port redire ## Upgrade +- **v1.4.2** + - Change the default font from ~~`Microsoft Sans Serif`~~ to **`Arial`**. + - This setting provides better compatibility on operating systems with fewer fonts. - **v1.4.1** - - Added a status strip at the bottom of the window. - - Added a check of the IP Helper service status, if the service is not running, a prompt will be displayed on the bottom status bar. + - Add a status strip at the bottom of the window. + - Add a check of the IP Helper service status, if the service is not running, a prompt will be displayed on the bottom status bar. - **v1.4.0** - Command line calls have been removed to provide better performance. - New Feature Added: **Remember Window/Column Size**.