Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WindivertDotnet.IFilter内lambda表达式不可使用集合类型判断,否则报错 #6

Open
zxcvbnm3057 opened this issue May 11, 2023 · 0 comments

Comments

@zxcvbnm3057
Copy link

报错内容:“variable 'filter' of type 'WindivertDotnet.IFilter' referenced from scope '', but it is not defined”

定位原因:

        public WinDivert(Filter filter, WinDivertLayer layer, short priority = 0, WinDivertFlag flags = WinDivertFlag.None)
            : this(filter.ToString(), layer, priority, flags)
        {
        }

filter.ToString()无法将集合转换为字符串

解决办法:

手写循环,将是否在集合中或集合取键值判断转为windivert filter language形式。

我对c#并不熟悉,上述集合类型义为hashset,dictionary等,具体哪些不能用可以参考WindivertDotnet.Filter.FilterTranslator的实现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant