refactor: 优化代码格式
This commit is contained in:
@@ -72,8 +72,9 @@ public static class PortProxy
|
|||||||
{
|
{
|
||||||
return Remove(item.Type, item.ListenAddress, item.ListenPort.ToString());
|
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 =
|
var output =
|
||||||
ExecuteCommand(
|
ExecuteCommand(
|
||||||
@@ -86,7 +87,8 @@ public static class PortProxy
|
|||||||
return Add(item.Type, item.ListenAddress, item.ListenPort, item.TargetAddress!, item.TargetPort ?? 0);
|
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 =
|
var output =
|
||||||
ExecuteCommand(
|
ExecuteCommand(
|
||||||
@@ -98,7 +100,7 @@ public static class PortProxy
|
|||||||
{
|
{
|
||||||
return Set(item.Type, item.ListenAddress, item.ListenPort, item.TargetAddress!, item.TargetPort ?? 0);
|
return Set(item.Type, item.ListenAddress, item.ListenPort, item.TargetAddress!, item.TargetPort ?? 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string[] ExecuteCommand(string command)
|
private static string[] ExecuteCommand(string command)
|
||||||
{
|
{
|
||||||
var startInfo = new ProcessStartInfo
|
var startInfo = new ProcessStartInfo
|
||||||
|
Reference in New Issue
Block a user