From 2478512b9dc57d51d5f3c090eab6895bfdacbb4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Thu, 20 Oct 2022 13:50:29 +0800 Subject: [PATCH] =?UTF-8?q?Format=E5=8F=96=E6=B6=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WindivertDotnet/Filter.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/WindivertDotnet/Filter.cs b/WindivertDotnet/Filter.cs index c484974..82eadfb 100644 --- a/WindivertDotnet/Filter.cs +++ b/WindivertDotnet/Filter.cs @@ -53,11 +53,10 @@ private Filter(Expression> expression) } /// - /// 格式化filter + /// 尝试格式化filter /// /// - /// - /// + /// /// [SupportedOSPlatform("windows")] public unsafe static string Format(string filter, WinDivertLayer layer) @@ -70,8 +69,7 @@ public unsafe static string Format(string filter, WinDivertLayer layer) var ptr = new IntPtr(buffer); return Marshal.PtrToStringAnsi(ptr) ?? string.Empty; } - - throw new FormatException($"{nameof(filter)}格式不正确"); + return filter; } ///