From a164919a38b336b25fce14b1ed10db00c3214e71 Mon Sep 17 00:00:00 2001 From: Jack <3486688394@qq.com> Date: Tue, 28 Jan 2025 22:59:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PortProxyTool/PortProxy.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PortProxyTool/PortProxy.cs b/PortProxyTool/PortProxy.cs index afb82ac..7224191 100644 --- a/PortProxyTool/PortProxy.cs +++ b/PortProxyTool/PortProxy.cs @@ -72,8 +72,9 @@ public static class PortProxy { return Remove(item.Type, item.ListenAddress, item.ListenPort.ToString()); } - - public static string Add(PortProxyType type, string listenAddress, ushort listenPort, string connectAddress, ushort connectPort, string protocol = "tcp") + + public static string Add(PortProxyType type, string listenAddress, ushort listenPort, string connectAddress, + ushort connectPort, string protocol = "tcp") { var output = ExecuteCommand( @@ -86,7 +87,8 @@ public static class PortProxy return Add(item.Type, item.ListenAddress, item.ListenPort, item.TargetAddress!, item.TargetPort ?? 0); } - public static string Set(PortProxyType type, string listenAddress, ushort listenPort, string connectAddress, ushort connectPort, string protocol = "tcp") + public static string Set(PortProxyType type, string listenAddress, ushort listenPort, string connectAddress, + ushort connectPort, string protocol = "tcp") { var output = ExecuteCommand( @@ -98,7 +100,7 @@ public static class PortProxy { return Set(item.Type, item.ListenAddress, item.ListenPort, item.TargetAddress!, item.TargetPort ?? 0); } - + private static string[] ExecuteCommand(string command) { var startInfo = new ProcessStartInfo