diff --git a/PortProxyGUI - Core31/PortProxyGUI - Core31.csproj b/PortProxyGUI - Core31/PortProxyGUI - Core31.csproj deleted file mode 100644 index ac879a3..0000000 --- a/PortProxyGUI - Core31/PortProxyGUI - Core31.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - WinExe - netcoreapp3.1 - true - app.manifest - zmjack - nstandard.net - A manager of the netsh interface portproxy which is to evaluate TCP/IP port redirect on windows. - https://github.com/zmjack/PortProxyGUI - https://github.com/zmjack/PortProxyGUI - git - portproxy TCP/IP redirector - LICENSE.md - Copyright © nstandard.net 2020 - 1.3.0 - icon.ico - PortProxyGUI - PortProxyGUI - - - - none - false - AnyCPU - - - - AnyCPU - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - - - - - - - - - - - - - - - Form - - - - - - Designer - - - - - - \ No newline at end of file diff --git a/PortProxyGUI - Core31/Program.cs b/PortProxyGUI - Core31/Program.cs deleted file mode 100644 index 02d1d48..0000000 --- a/PortProxyGUI - Core31/Program.cs +++ /dev/null @@ -1,24 +0,0 @@ -using PortProxyGUI.Data; -using System; -using System.Windows.Forms; - -namespace PortProxyGUI -{ - static class Program - { - public static readonly ApplicationDbScope SqliteDbScope = ApplicationDbScope.UseDefault(); - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - SqliteDbScope.Migrate(); - Application.SetHighDpiMode(HighDpiMode.SystemAware); - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new PortProxyGUI()); - } - } -} diff --git a/PortProxyGUI - Core31/app.manifest b/PortProxyGUI - Core31/app.manifest deleted file mode 100644 index 169e618..0000000 --- a/PortProxyGUI - Core31/app.manifest +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PortProxyGUI - Core31/icon.ico b/PortProxyGUI - Core31/icon.ico deleted file mode 100644 index a4316bc..0000000 Binary files a/PortProxyGUI - Core31/icon.ico and /dev/null differ diff --git a/PortProxyGUI - NET35/PortProxyGUI - NET35 - UI.csproj b/PortProxyGUI - NET35/PortProxyGUI - NET35 - UI.csproj deleted file mode 100644 index 5f2f474..0000000 --- a/PortProxyGUI - NET35/PortProxyGUI - NET35 - UI.csproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - Debug - AnyCPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F} - WinExe - PortProxyGUI - PortProxyGUI - v3.5 - 512 - true - false - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - none - true - bin\Release\ - TRACE;NET35 - prompt - 4 - - - app.manifest - - - icon.ico - - - BEF27898E4C102E806F3241497048E740EC39033 - - - PortProxyGUI - NET_TemporaryKey.pfx - - - false - - - false - - - LocalIntranet - - - - ..\packages\NStandard.0.6.7.1\lib\net35\NStandard.dll - - - ..\packages\SQLib.0.8.6\lib\net35\SQLib.dll - - - ..\packages\SQLib.Sqlite.0.8.6\lib\net35\SQLib.Sqlite.dll - - - - - ..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.3\lib\net20\System.Data.SQLite.dll - - - - - - - - - - - - - Form - - - About.cs - - - Form - - - PortProxyGUI.cs - - - - - Form - - - SetProxy.cs - - - About.cs - - - About.cs - - - PortProxyGUI.cs - - - PortProxyGUI.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - SetProxy.cs - - - SetProxy.cs - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - False - .NET Framework 3.5 SP1 - true - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/PortProxyGUI - NET35/Program.cs b/PortProxyGUI - NET35/Program.cs deleted file mode 100644 index 8a8a627..0000000 --- a/PortProxyGUI - NET35/Program.cs +++ /dev/null @@ -1,24 +0,0 @@ -using PortProxyGUI.Data; -using System; -using System.Drawing; -using System.Windows.Forms; - -namespace PortProxyGUI -{ - static class Program - { - public static readonly ApplicationDbScope SqliteDbScope = ApplicationDbScope.UseDefault(); - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - SqliteDbScope.Migrate(); - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new PortProxyGUI()); - } - } -} diff --git a/PortProxyGUI - NET35/Properties/AssemblyInfo.cs b/PortProxyGUI - NET35/Properties/AssemblyInfo.cs deleted file mode 100644 index 4e0baa1..0000000 --- a/PortProxyGUI - NET35/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("PortProxyGUI - NET")] -[assembly: AssemblyDescription("A manager of the netsh interface portproxy which is to evaluate TCP/IP port redirect on windows.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("nstandard.net")] -[assembly: AssemblyProduct("PortProxyGUI - NET")] -[assembly: AssemblyCopyright("Copyright © nstandard.net 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1b166039-e98c-404a-89a5-c981364b5546")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] diff --git a/PortProxyGUI - NET35/Properties/Resources.Designer.cs b/PortProxyGUI - NET35/Properties/Resources.Designer.cs deleted file mode 100644 index 0edb72f..0000000 --- a/PortProxyGUI - NET35/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace PortProxyGUI.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PortProxyGUI.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/PortProxyGUI - NET35/Properties/Resources.resx b/PortProxyGUI - NET35/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/PortProxyGUI - NET35/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PortProxyGUI - NET35/Properties/Settings.Designer.cs b/PortProxyGUI - NET35/Properties/Settings.Designer.cs deleted file mode 100644 index 62dbe99..0000000 --- a/PortProxyGUI - NET35/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace PortProxyGUI.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/PortProxyGUI - NET35/Properties/Settings.settings b/PortProxyGUI - NET35/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/PortProxyGUI - NET35/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/PortProxyGUI - NET35/app.config b/PortProxyGUI - NET35/app.config deleted file mode 100644 index c5c407b..0000000 --- a/PortProxyGUI - NET35/app.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/PortProxyGUI - NET35/app.manifest b/PortProxyGUI - NET35/app.manifest deleted file mode 100644 index f6a3bf4..0000000 --- a/PortProxyGUI - NET35/app.manifest +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PortProxyGUI - NET35/icon.ico b/PortProxyGUI - NET35/icon.ico deleted file mode 100644 index a4316bc..0000000 Binary files a/PortProxyGUI - NET35/icon.ico and /dev/null differ diff --git a/PortProxyGUI - NET35/packages.config b/PortProxyGUI - NET35/packages.config deleted file mode 100644 index e90e544..0000000 --- a/PortProxyGUI - NET35/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/PortProxyGUI - NET45/PortProxyGUI - NET45.csproj b/PortProxyGUI - NET45/PortProxyGUI - NET45.csproj deleted file mode 100644 index 5509a2b..0000000 --- a/PortProxyGUI - NET45/PortProxyGUI - NET45.csproj +++ /dev/null @@ -1,186 +0,0 @@ - - - - - Debug - AnyCPU - {1B166039-E98C-404A-89A5-C981364B5546} - WinExe - PortProxyGUI - PortProxyGUI - v4.5 - 512 - true - false - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - none - true - bin\Release\ - TRACE;NET45 - prompt - 4 - false - - - app.manifest - - - icon.ico - - - BEF27898E4C102E806F3241497048E740EC39033 - - - PortProxyGUI - NET_TemporaryKey.pfx - - - false - - - false - - - LocalIntranet - - - - ..\packages\NStandard.0.6.7.1\lib\net45\NStandard.dll - - - ..\packages\SQLib.0.8.6\lib\net45\SQLib.dll - - - ..\packages\SQLib.Sqlite.0.8.6\lib\net45\SQLib.Sqlite.dll - - - - - - - ..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.3\lib\net45\System.Data.SQLite.dll - - - - - - - - - - - - - About.cs - Form - - - About.Designer.cs - - - PortProxyGUI.cs - Form - - - PortProxyGUI.Designer.cs - - - SetProxy.cs - Form - - - SetProxy.Designer.cs - - - - - About.resx - - - About.zh-CN.resx - - - PortProxyGUI.resx - - - PortProxyGUI.zh-CN.resx - - - SetProxy.resx - - - SetProxy.zh-CN.resx - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - False - .NET Framework 3.5 SP1 - true - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/PortProxyGUI - NET45/Program.cs b/PortProxyGUI - NET45/Program.cs deleted file mode 100644 index 2e2c332..0000000 --- a/PortProxyGUI - NET45/Program.cs +++ /dev/null @@ -1,23 +0,0 @@ -using PortProxyGUI.Data; -using System; -using System.Windows.Forms; - -namespace PortProxyGUI -{ - static class Program - { - public static readonly ApplicationDbScope SqliteDbScope = ApplicationDbScope.UseDefault(); - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - SqliteDbScope.Migrate(); - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new PortProxyGUI()); - } - } -} diff --git a/PortProxyGUI - NET45/Properties/AssemblyInfo.cs b/PortProxyGUI - NET45/Properties/AssemblyInfo.cs deleted file mode 100644 index 4e0baa1..0000000 --- a/PortProxyGUI - NET45/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("PortProxyGUI - NET")] -[assembly: AssemblyDescription("A manager of the netsh interface portproxy which is to evaluate TCP/IP port redirect on windows.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("nstandard.net")] -[assembly: AssemblyProduct("PortProxyGUI - NET")] -[assembly: AssemblyCopyright("Copyright © nstandard.net 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1b166039-e98c-404a-89a5-c981364b5546")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] diff --git a/PortProxyGUI - NET45/Properties/Resources.Designer.cs b/PortProxyGUI - NET45/Properties/Resources.Designer.cs deleted file mode 100644 index 0edb72f..0000000 --- a/PortProxyGUI - NET45/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace PortProxyGUI.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PortProxyGUI.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/PortProxyGUI - NET45/Properties/Resources.resx b/PortProxyGUI - NET45/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/PortProxyGUI - NET45/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PortProxyGUI - NET45/Properties/Settings.Designer.cs b/PortProxyGUI - NET45/Properties/Settings.Designer.cs deleted file mode 100644 index 7085b3e..0000000 --- a/PortProxyGUI - NET45/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace PortProxyGUI.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/PortProxyGUI - NET45/Properties/Settings.settings b/PortProxyGUI - NET45/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/PortProxyGUI - NET45/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/PortProxyGUI - NET45/app.config b/PortProxyGUI - NET45/app.config deleted file mode 100644 index c81d505..0000000 --- a/PortProxyGUI - NET45/app.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/PortProxyGUI - NET45/app.manifest b/PortProxyGUI - NET45/app.manifest deleted file mode 100644 index f6a3bf4..0000000 --- a/PortProxyGUI - NET45/app.manifest +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PortProxyGUI - NET45/icon.ico b/PortProxyGUI - NET45/icon.ico deleted file mode 100644 index a4316bc..0000000 Binary files a/PortProxyGUI - NET45/icon.ico and /dev/null differ diff --git a/PortProxyGUI - NET45/packages.config b/PortProxyGUI - NET45/packages.config deleted file mode 100644 index 91ca9b1..0000000 --- a/PortProxyGUI - NET45/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/PortProxyGUI.Shared/PortProxy.cs b/PortProxyGUI.Shared/PortProxy.cs deleted file mode 100644 index ef9fc6c..0000000 --- a/PortProxyGUI.Shared/PortProxy.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace PortProxyGUI -{ - public class PortProxy - { - public string Type { get; set; } - - public string ListenOn { get; set; } - public string ListenPort { get; set; } - - public string ConnectTo { get; set; } - public string ConnectPort { get; set; } - - } - -} diff --git a/PortProxyGUI.Shared/PortProxyGUI.Shared.projitems b/PortProxyGUI.Shared/PortProxyGUI.Shared.projitems deleted file mode 100644 index ff4625d..0000000 --- a/PortProxyGUI.Shared/PortProxyGUI.Shared.projitems +++ /dev/null @@ -1,23 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - b38ef2b9-e38d-4d6d-bf0d-7c1934d6cfdc - - - PortProxyGUI - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PortProxyGUI.Shared/PortProxyGUI.Shared.shproj b/PortProxyGUI.Shared/PortProxyGUI.Shared.shproj deleted file mode 100644 index f04ef6e..0000000 --- a/PortProxyGUI.Shared/PortProxyGUI.Shared.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - b38ef2b9-e38d-4d6d-bf0d-7c1934d6cfdc - 14.0 - - - - - - - - diff --git a/PortProxyGUI.sln b/PortProxyGUI.sln index 5023366..1aa68ce 100644 --- a/PortProxyGUI.sln +++ b/PortProxyGUI.sln @@ -5,32 +5,17 @@ VisualStudioVersion = 17.1.32210.238 MinimumVisualStudioVersion = 15.0.26124.0 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PortProxyGUI", "PortProxyGUI\PortProxyGUI.csproj", "{7459E9F4-8B98-42D6-92CF-E90961E05C90}" EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "PortProxyGUI.Shared", "PortProxyGUI.Shared\PortProxyGUI.Shared.shproj", "{B38EF2B9-E38D-4D6D-BF0D-7C1934D6CFDC}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{E48EF63C-74A5-42B5-BFC5-20652E856B1F}" ProjectSection(SolutionItems) = preProject docs\ui.png = docs\ui.png EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PortProxyGUI - NET45", "PortProxyGUI - NET45\PortProxyGUI - NET45.csproj", "{1B166039-E98C-404A-89A5-C981364B5546}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PortProxyGUI - NET35 - UI", "PortProxyGUI - NET35\PortProxyGUI - NET35 - UI.csproj", "{56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PortProxyGUI - Core31", "PortProxyGUI - Core31\PortProxyGUI - Core31.csproj", "{2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{444021F3-829E-4682-ACD5-B57FA46CC534}" ProjectSection(SolutionItems) = preProject README.md = README.md EndProjectSection EndProject Global - GlobalSection(SharedMSBuildProjectFiles) = preSolution - PortProxyGUI.Shared\PortProxyGUI.Shared.projitems*{1b166039-e98c-404a-89a5-c981364b5546}*SharedItemsImports = 4 - PortProxyGUI.Shared\PortProxyGUI.Shared.projitems*{2a54c624-1c2f-4ed7-b201-0e2981fb9cd9}*SharedItemsImports = 5 - PortProxyGUI.Shared\PortProxyGUI.Shared.projitems*{56fb1cbc-bd89-47d7-a9d5-86f02eef480f}*SharedItemsImports = 4 - PortProxyGUI.Shared\PortProxyGUI.Shared.projitems*{7459e9f4-8b98-42d6-92cf-e90961e05c90}*SharedItemsImports = 5 - PortProxyGUI.Shared\PortProxyGUI.Shared.projitems*{b38ef2b9-e38d-4d6d-bf0d-7c1934d6cfdc}*SharedItemsImports = 13 - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 @@ -52,42 +37,6 @@ Global {7459E9F4-8B98-42D6-92CF-E90961E05C90}.Release|x64.Build.0 = Release|Any CPU {7459E9F4-8B98-42D6-92CF-E90961E05C90}.Release|x86.ActiveCfg = Release|Any CPU {7459E9F4-8B98-42D6-92CF-E90961E05C90}.Release|x86.Build.0 = Release|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Debug|x64.ActiveCfg = Debug|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Debug|x64.Build.0 = Debug|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Debug|x86.ActiveCfg = Debug|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Debug|x86.Build.0 = Debug|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Release|Any CPU.Build.0 = Release|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Release|x64.ActiveCfg = Release|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Release|x64.Build.0 = Release|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Release|x86.ActiveCfg = Release|Any CPU - {1B166039-E98C-404A-89A5-C981364B5546}.Release|x86.Build.0 = Release|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Debug|x64.ActiveCfg = Debug|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Debug|x64.Build.0 = Debug|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Debug|x86.ActiveCfg = Debug|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Debug|x86.Build.0 = Debug|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Release|Any CPU.Build.0 = Release|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Release|x64.ActiveCfg = Release|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Release|x64.Build.0 = Release|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Release|x86.ActiveCfg = Release|Any CPU - {56FB1CBC-BD89-47D7-A9D5-86F02EEF480F}.Release|x86.Build.0 = Release|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Debug|x64.ActiveCfg = Debug|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Debug|x64.Build.0 = Debug|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Debug|x86.ActiveCfg = Debug|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Debug|x86.Build.0 = Debug|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Release|Any CPU.Build.0 = Release|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Release|x64.ActiveCfg = Release|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Release|x64.Build.0 = Release|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Release|x86.ActiveCfg = Release|Any CPU - {2A54C624-1C2F-4ED7-B201-0E2981FB9CD9}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PortProxyGUI - NET35/About.Designer.cs b/PortProxyGUI/About.Designer.cs similarity index 100% rename from PortProxyGUI - NET35/About.Designer.cs rename to PortProxyGUI/About.Designer.cs diff --git a/PortProxyGUI - NET35/About.cs b/PortProxyGUI/About.cs similarity index 100% rename from PortProxyGUI - NET35/About.cs rename to PortProxyGUI/About.cs diff --git a/PortProxyGUI - NET35/About.resx b/PortProxyGUI/About.resx similarity index 100% rename from PortProxyGUI - NET35/About.resx rename to PortProxyGUI/About.resx diff --git a/PortProxyGUI - NET35/About.zh-CN.resx b/PortProxyGUI/About.zh-CN.resx similarity index 100% rename from PortProxyGUI - NET35/About.zh-CN.resx rename to PortProxyGUI/About.zh-CN.resx diff --git a/PortProxyGUI.Shared/Data/ApplicationDbMigrationUtil.cs b/PortProxyGUI/Data/ApplicationDbMigrationUtil.cs similarity index 100% rename from PortProxyGUI.Shared/Data/ApplicationDbMigrationUtil.cs rename to PortProxyGUI/Data/ApplicationDbMigrationUtil.cs diff --git a/PortProxyGUI.Shared/Data/ApplicationDbScope.cs b/PortProxyGUI/Data/ApplicationDbScope.cs similarity index 100% rename from PortProxyGUI.Shared/Data/ApplicationDbScope.cs rename to PortProxyGUI/Data/ApplicationDbScope.cs diff --git a/PortProxyGUI.Shared/Data/Migration.cs b/PortProxyGUI/Data/Migration.cs similarity index 100% rename from PortProxyGUI.Shared/Data/Migration.cs rename to PortProxyGUI/Data/Migration.cs diff --git a/PortProxyGUI.Shared/Data/MigrationKey.cs b/PortProxyGUI/Data/MigrationKey.cs similarity index 100% rename from PortProxyGUI.Shared/Data/MigrationKey.cs rename to PortProxyGUI/Data/MigrationKey.cs diff --git a/PortProxyGUI.Shared/Data/Rule.cs b/PortProxyGUI/Data/Rule.cs similarity index 67% rename from PortProxyGUI.Shared/Data/Rule.cs rename to PortProxyGUI/Data/Rule.cs index 7b0d953..a777399 100644 --- a/PortProxyGUI.Shared/Data/Rule.cs +++ b/PortProxyGUI/Data/Rule.cs @@ -14,6 +14,28 @@ namespace PortProxyGUI.Data public string Comment { get; set; } public string Group { get; set; } + public bool Valid => ListenPort > 0 && ConnectPort > 0; + + private string _realListenPort; + /// + /// Not mapped + /// + public string RealListenPort + { + get => ListenPort > 0 ? ListenPort.ToString() : _realListenPort; + set => _realListenPort = value; + } + + private string _realConnectPort; + /// + /// Not mapped + /// + public string RealConnectPort + { + get => ConnectPort > 0 ? ConnectPort.ToString() : _realConnectPort; + set => _realConnectPort = value; + } + public bool Equals(Rule other) { return Id == other.Id diff --git a/PortProxyGUI - NET35/PortProxyGUI.Designer.cs b/PortProxyGUI/PortProxyGUI.Designer.cs similarity index 100% rename from PortProxyGUI - NET35/PortProxyGUI.Designer.cs rename to PortProxyGUI/PortProxyGUI.Designer.cs diff --git a/PortProxyGUI - NET35/PortProxyGUI.cs b/PortProxyGUI/PortProxyGUI.cs similarity index 98% rename from PortProxyGUI - NET35/PortProxyGUI.cs rename to PortProxyGUI/PortProxyGUI.cs index 5f88365..636a17e 100644 --- a/PortProxyGUI - NET35/PortProxyGUI.cs +++ b/PortProxyGUI/PortProxyGUI.cs @@ -181,8 +181,8 @@ namespace PortProxyGUI proxy.Id = matchedRule?.Id; } - var pendingAdds = proxies.Where(x => x.Id == null); - var pendingUpdates = proxies.Where(x => x.Id != null && !x.Equals(rules.First(r => r.Id == x.Id))); + var pendingAdds = proxies.Where(x => x.Valid && x.Id == null); + var pendingUpdates = proxies.Where(x => x.Valid && x.Id != null && !x.Equals(rules.First(r => r.Id == x.Id))); Program.SqliteDbScope.AddRange(pendingAdds); Program.SqliteDbScope.UpdateRange(pendingUpdates); diff --git a/PortProxyGUI/PortProxyGUI.csproj b/PortProxyGUI/PortProxyGUI.csproj index 6f38aa3..0a05177 100644 --- a/PortProxyGUI/PortProxyGUI.csproj +++ b/PortProxyGUI/PortProxyGUI.csproj @@ -2,7 +2,7 @@ WinExe - net6.0-windows + net6.0-windows;netcoreapp3.1;net35;net451 true app.manifest zmjack @@ -14,8 +14,11 @@ portproxy TCP/IP redirector LICENSE.md Copyright © nstandard.net 2020 - 1.3.0 + 1.3.1 icon.ico + Microsoft Sans Serif, 8pt + PPGUI + preview @@ -28,24 +31,6 @@ AnyCPU - - - - - - - - - - - - - - - - - - True @@ -57,12 +42,4 @@ - - - Form - - - - - \ No newline at end of file diff --git a/PortProxyGUI - NET35/PortProxyGUI.resx b/PortProxyGUI/PortProxyGUI.resx similarity index 100% rename from PortProxyGUI - NET35/PortProxyGUI.resx rename to PortProxyGUI/PortProxyGUI.resx diff --git a/PortProxyGUI - NET35/PortProxyGUI.zh-CN.resx b/PortProxyGUI/PortProxyGUI.zh-CN.resx similarity index 100% rename from PortProxyGUI - NET35/PortProxyGUI.zh-CN.resx rename to PortProxyGUI/PortProxyGUI.zh-CN.resx diff --git a/PortProxyGUI/Program.cs b/PortProxyGUI/Program.cs index 42277c3..0670b84 100644 --- a/PortProxyGUI/Program.cs +++ b/PortProxyGUI/Program.cs @@ -18,7 +18,16 @@ 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 + Application.SetHighDpiMode(HighDpiMode.SystemAware); + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); +#else + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); +#endif Application.Run(new PortProxyGUI()); } } diff --git a/PortProxyGUI - NET35/SetProxy.Designer.cs b/PortProxyGUI/SetProxy.Designer.cs similarity index 98% rename from PortProxyGUI - NET35/SetProxy.Designer.cs rename to PortProxyGUI/SetProxy.Designer.cs index 1864433..6176392 100644 --- a/PortProxyGUI - NET35/SetProxy.Designer.cs +++ b/PortProxyGUI/SetProxy.Designer.cs @@ -115,10 +115,10 @@ resources.ApplyResources(this.label_Comment, "label_Comment"); this.label_Comment.Name = "label_Comment"; // - // textBox_Note + // textBox_Comment // - resources.ApplyResources(this.textBox_Comment, "textBox_Note"); - this.textBox_Comment.Name = "textBox_Note"; + resources.ApplyResources(this.textBox_Comment, "textBox_Comment"); + this.textBox_Comment.Name = "textBox_Comment"; // // label_Group // diff --git a/PortProxyGUI - NET35/SetProxy.cs b/PortProxyGUI/SetProxy.cs similarity index 100% rename from PortProxyGUI - NET35/SetProxy.cs rename to PortProxyGUI/SetProxy.cs diff --git a/PortProxyGUI - NET35/SetProxy.resx b/PortProxyGUI/SetProxy.resx similarity index 96% rename from PortProxyGUI - NET35/SetProxy.resx rename to PortProxyGUI/SetProxy.resx index a5a6423..e5cf25b 100644 --- a/PortProxyGUI - NET35/SetProxy.resx +++ b/PortProxyGUI/SetProxy.resx @@ -1,64 +1,4 @@ - - - + @@ -117,18 +57,18 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + True - + Microsoft YaHei UI, 9pt - 14, 57 + 14, 62 - + 4, 0, 4, 0 @@ -145,7 +85,7 @@ label_ListenOn - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -157,7 +97,7 @@ Microsoft YaHei UI, 9pt - 97, 54 + 97, 58 4, 3, 4, 3 @@ -178,7 +118,7 @@ textBox_ListenOn - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -193,7 +133,7 @@ Microsoft YaHei UI, 9pt - 14, 86 + 14, 93 4, 0, 4, 0 @@ -211,7 +151,7 @@ label_ConnectTo - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -223,7 +163,7 @@ Microsoft YaHei UI, 9pt - 97, 83 + 97, 90 4, 3, 4, 3 @@ -232,7 +172,7 @@ 146, 23 - 3 + 2 Center @@ -241,7 +181,7 @@ textBox_ConnectTo - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -253,7 +193,7 @@ Microsoft YaHei UI, 9pt - 299, 83 + 299, 90 4, 3, 4, 3 @@ -262,7 +202,7 @@ 84, 23 - 4 + 3 Center @@ -271,7 +211,7 @@ textBox_ConnectPort - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -286,7 +226,7 @@ Microsoft YaHei UI, 9pt - 251, 86 + 251, 93 4, 0, 4, 0 @@ -304,7 +244,7 @@ label_ConnectPort - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -316,16 +256,16 @@ Microsoft YaHei UI, 9pt - 258, 122 + 260, 134 - 4, 4, 4, 4 + 4, 5, 4, 5 - 125, 32 + 125, 31 - 6 + 7 Set @@ -334,7 +274,7 @@ button_Set - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -349,7 +289,7 @@ Microsoft YaHei UI, 9pt - 14, 15 + 14, 16 4, 0, 4, 0 @@ -367,7 +307,7 @@ label_Type - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -382,7 +322,7 @@ Microsoft YaHei UI, 9pt - 251, 57 + 251, 62 4, 0, 4, 0 @@ -400,7 +340,7 @@ label_ListenPort - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -412,7 +352,7 @@ Microsoft YaHei UI, 9pt - 299, 54 + 299, 58 4, 3, 4, 3 @@ -421,7 +361,7 @@ 84, 23 - 2 + 1 Center @@ -430,7 +370,7 @@ textBox_ListenPort - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -457,7 +397,7 @@ v6tov6 - 97, 12 + 97, 13 4, 3, 4, 3 @@ -472,7 +412,7 @@ comboBox_Type - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.ComboBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -490,7 +430,7 @@ NoControl - 14, 130 + 14, 141 4, 0, 4, 0 @@ -508,7 +448,7 @@ label_Comment - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -516,34 +456,34 @@ 3 - + Microsoft YaHei UI, 9pt - - 97, 127 + + 97, 138 - + 4, 3, 4, 3 - + 146, 23 - - 8 + + 4 - + Center - - textBox_Note + + textBox_Comment - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 2 @@ -556,7 +496,7 @@ NoControl - 251, 15 + 251, 16 4, 0, 4, 0 @@ -574,7 +514,7 @@ label_Group - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -586,7 +526,7 @@ Microsoft YaHei UI, 9pt - 299, 12 + 299, 13 4, 3, 4, 3 @@ -595,13 +535,13 @@ 84, 25 - 10 + 6 comboBox_Group - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.ComboBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -609,14 +549,14 @@ 0 - + True - 6, 12 + 6, 13 - 398, 169 + 398, 183 @@ -2789,6 +2729,6 @@ SetProxy - System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Form, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/PortProxyGUI - NET35/SetProxy.zh-CN.resx b/PortProxyGUI/SetProxy.zh-CN.resx similarity index 98% rename from PortProxyGUI - NET35/SetProxy.zh-CN.resx rename to PortProxyGUI/SetProxy.zh-CN.resx index 10b6dad..7f44441 100644 --- a/PortProxyGUI - NET35/SetProxy.zh-CN.resx +++ b/PortProxyGUI/SetProxy.zh-CN.resx @@ -112,23 +112,23 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + True - + Microsoft YaHei UI, 9pt - 14, 57 + 14, 62 - + 4, 0, 4, 0 @@ -145,7 +145,7 @@ label_ListenOn - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -157,7 +157,7 @@ Microsoft YaHei UI, 9pt - 97, 54 + 97, 58 4, 3, 4, 3 @@ -178,7 +178,7 @@ textBox_ListenOn - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -193,7 +193,7 @@ Microsoft YaHei UI, 9pt - 14, 86 + 14, 93 4, 0, 4, 0 @@ -205,13 +205,13 @@ 0 - 转发地址 + 连接地址 label_ConnectTo - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -223,7 +223,7 @@ Microsoft YaHei UI, 9pt - 97, 83 + 97, 90 4, 3, 4, 3 @@ -232,7 +232,7 @@ 146, 23 - 3 + 2 Center @@ -241,7 +241,7 @@ textBox_ConnectTo - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -253,7 +253,7 @@ Microsoft YaHei UI, 9pt - 299, 83 + 299, 90 4, 3, 4, 3 @@ -262,7 +262,7 @@ 84, 23 - 4 + 3 Center @@ -271,7 +271,7 @@ textBox_ConnectPort - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -286,7 +286,7 @@ Microsoft YaHei UI, 9pt - 251, 86 + 251, 93 4, 0, 4, 0 @@ -304,7 +304,7 @@ label_ConnectPort - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -316,16 +316,16 @@ Microsoft YaHei UI, 9pt - 258, 122 + 260, 134 - 4, 4, 4, 4 + 4, 5, 4, 5 - 125, 32 + 125, 31 - 6 + 7 设置 @@ -334,7 +334,7 @@ button_Set - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -349,7 +349,7 @@ Microsoft YaHei UI, 9pt - 14, 15 + 14, 16 4, 0, 4, 0 @@ -367,7 +367,7 @@ label_Type - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -382,7 +382,7 @@ Microsoft YaHei UI, 9pt - 251, 57 + 251, 62 4, 0, 4, 0 @@ -400,7 +400,7 @@ label_ListenPort - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -412,7 +412,7 @@ Microsoft YaHei UI, 9pt - 299, 54 + 299, 58 4, 3, 4, 3 @@ -421,7 +421,7 @@ 84, 23 - 2 + 1 Center @@ -430,7 +430,7 @@ textBox_ListenPort - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -442,7 +442,7 @@ Microsoft YaHei UI, 9pt - (自动) + (自动) v4tov4 @@ -457,7 +457,7 @@ v6tov6 - 97, 12 + 97, 13 4, 3, 4, 3 @@ -472,7 +472,7 @@ comboBox_Type - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.ComboBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -490,7 +490,7 @@ NoControl - 14, 130 + 14, 141 4, 0, 4, 0 @@ -508,7 +508,7 @@ label_Comment - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -516,34 +516,34 @@ 3 - + Microsoft YaHei UI, 9pt - - 97, 127 + + 97, 138 - + 4, 3, 4, 3 - + 146, 23 - - 8 + + 4 - + Center - - textBox_Note + + textBox_Comment - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 2 @@ -556,7 +556,7 @@ NoControl - 251, 15 + 251, 16 4, 0, 4, 0 @@ -574,7 +574,7 @@ label_Group - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -586,7 +586,7 @@ Microsoft YaHei UI, 9pt - 299, 12 + 299, 13 4, 3, 4, 3 @@ -595,13 +595,13 @@ 84, 25 - 10 + 6 comboBox_Group - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.ComboBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -613,10 +613,10 @@ True - 6, 12 + 6, 13 - 398, 169 + 398, 183 @@ -2789,6 +2789,6 @@ SetProxy - System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Form, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/PortProxyGUI.Shared/CmdRunner.cs b/PortProxyGUI/~DS/CmdRunner.cs similarity index 100% rename from PortProxyGUI.Shared/CmdRunner.cs rename to PortProxyGUI/~DS/CmdRunner.cs diff --git a/PortProxyGUI.Shared/CmdUtil.cs b/PortProxyGUI/~DS/CmdUtil.cs similarity index 58% rename from PortProxyGUI.Shared/CmdUtil.cs rename to PortProxyGUI/~DS/CmdUtil.cs index f883825..fbab17d 100644 --- a/PortProxyGUI.Shared/CmdUtil.cs +++ b/PortProxyGUI/~DS/CmdUtil.cs @@ -22,6 +22,8 @@ namespace PortProxyGUI ["ipv6 to ipv6"] = GetRegex("ipv6", "ipv6"), }; + private static readonly Regex LineRegex = new(@"^(.*?)\s{1,}(.*?)\s{1,}(.*?)\s{1,}(.*?)$"); + public static Rule[] GetProxies() { var output = CmdRunner.Execute("netsh interface portproxy show all"); @@ -33,26 +35,39 @@ namespace PortProxyGUI new ProxyType("ipv6", "ipv6"), }; - var proxies = types.SelectMany(type => + var list = new List(); + foreach (var type in types) { var regex = RegexList[$"{type.From} to {type.To}"]; - var typeProxies = output.ExtractFirst(regex) - ?.Split(new[] { Environment.NewLine }, StringSplitOptions.None) - .Select(line => + var settings = output.ExtractFirst(regex); + var lines = settings?.Split(new[] { Environment.NewLine }, StringSplitOptions.None); + + if (lines is not null) + { + foreach (var line in lines) { - var parts = line.Resolve(new Regex(@"^([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)$")); - return new Rule + if (line.TryResolve(LineRegex, out var parts)) { - Type = type.Type, - ListenOn = parts[1].First(), - ListenPort = int.Parse(parts[2].First()), - ConnectTo = parts[3].First(), - ConnectPort = int.Parse(parts[4].First()), - }; - }); - return typeProxies ?? new Rule[0]; - }); - return proxies.ToArray(); + var realListenPort = parts[2].First(); + var realConnectPort = parts[4].First(); + + _ = int.TryParse(realListenPort, out var listenPort); + _ = int.TryParse(realConnectPort, out var connectPort); + + list.Add(new Rule + { + Type = type.Type, + ListenOn = parts[1].First(), + ListenPort = listenPort, + ConnectTo = parts[3].First(), + ConnectPort = connectPort, + }); + } + } + } + } + + return list.ToArray(); } public static void AddOrUpdateProxy(Rule rule) diff --git a/PortProxyGUI.Shared/ListViewColumnSorter.cs b/PortProxyGUI/~DS/ListViewColumnSorter.cs similarity index 100% rename from PortProxyGUI.Shared/ListViewColumnSorter.cs rename to PortProxyGUI/~DS/ListViewColumnSorter.cs diff --git a/PortProxyGUI.Shared/ProxyType.cs b/PortProxyGUI/~DS/ProxyType.cs similarity index 100% rename from PortProxyGUI.Shared/ProxyType.cs rename to PortProxyGUI/~DS/ProxyType.cs diff --git a/PortProxyGUI.Shared/Util.cs b/PortProxyGUI/~DS/Util.cs similarity index 78% rename from PortProxyGUI.Shared/Util.cs rename to PortProxyGUI/~DS/Util.cs index 008347f..28307d6 100644 --- a/PortProxyGUI.Shared/Util.cs +++ b/PortProxyGUI/~DS/Util.cs @@ -11,7 +11,7 @@ namespace PortProxyGUI /// Compatibility between .NET Framework and .NET Core. /// /// - public static readonly Font UiFont = new Font(new FontFamily("Microsoft Sans Serif"), 8f); + public static readonly Font UiFont = new(new FontFamily("Microsoft Sans Serif"), 8f); } } diff --git a/README.md b/README.md index 3918126..b54547a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ A manager for netsh interface portproxy, which is to evaluate TCP/IP port redire ## Upgrade +- **v1.3.1** + - Fix program crash caused by wrong rules. - **v1.3.0** - Update display, provide comments and grouping. - Fix the problem that the window size is not the same in different runtimes.