From f519850ffc7dd776d7bc328097068e003fedf266 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Sat, 20 Mar 2021 00:50:06 +0800 Subject: [PATCH] Trim --- Netch/Controllers/NFController.cs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/Netch/Controllers/NFController.cs b/Netch/Controllers/NFController.cs index 3539d9be..0d3af549 100644 --- a/Netch/Controllers/NFController.cs +++ b/Netch/Controllers/NFController.cs @@ -17,28 +17,9 @@ namespace Netch.Controllers { private static readonly ServiceController NFService = new("netfilter2"); - private static readonly string BinDriver; + private const string BinDriver = "bin\\nfdriver.sys"; private static readonly string SystemDriver = $"{Environment.SystemDirectory}\\drivers\\netfilter2.sys"; - static NFController() - { - string fileName; - switch ($"{Environment.OSVersion.Version.Major}.{Environment.OSVersion.Version.Minor}") - { - case "10.0": - case "6.3": - case "6.2": - case "6.1": - case "6.0": - fileName = "nfdriver.sys"; - break; - default: - throw new MessageException($"不支持的系统版本:{Environment.OSVersion.Version}"); - } - - BinDriver = "bin\\" + fileName; - } - public string Name { get; } = "Redirector"; public void Start(in Mode mode)