C# 操作防火墙 listview
5、listview自绘
不错,正是要要的
https://learn.microsoft.com/zh-cn/dotnet/api/system.windows.forms.listview.ownerdraw?view=windowsdesktop-7.0&redirectedfrom=MSDN#System_Windows_Forms_ListView_OwnerDraw
4、
https://www.cnblogs.com/bobositlife/p/csharp-winform-change-richtextbox-font-color-using-static-extension-method.html
1、.net做安装包
https://www.cnblogs.com/jenry/articles/255249.html
------
https://www.cnblogs.com/code1992/p/11661078.html
/// <summary> /// 通过对象防火墙操作 /// </summary> /// <param name="isOpenDomain">域网络防火墙(禁用:false;启用(默认):true)</param> /// <param name="isOpenPublicState">公共网络防火墙(禁用:false;启用(默认):true)</param> /// <param name="isOpenStandard">专用网络防火墙(禁用: false;启用(默认):true)</param> /// <returns></returns> public static bool FirewallOperateByObject(bool isOpenDomain = true, bool isOpenPublicState = true, bool isOpenStandard = true) { try { INetFwPolicy2 firewallPolicy = (INetFwPolicy2)Activator.CreateInstance(Type.GetTypeFromProgID("HNetCfg.FwPolicy2")); // 启用<高级安全Windows防火墙> - 专有配置文件的防火墙 firewallPolicy.set_FirewallEnabled(NET_FW_PROFILE_TYPE2_.NET_FW_PROFILE2_PRIVATE, isOpenStandard); // 启用<高级安全Windows防火墙> - 公用配置文件的防火墙 firewallPolicy.set_FirewallEnabled(NET_FW_PROFILE_TYPE2_.NET_FW_PROFILE2_PUBLIC, isOpenPublicState); // 启用<高级安全Windows防火墙> - 域配置文件的防火墙 firewallPolicy.set_FirewallEnabled(NET_FW_PROFILE_TYPE2_.NET_FW_PROFILE2_DOMAIN, isOpenDomain); } catch (Exception e) { string error = $"防火墙修改出错:{e.Message}"; throw new Exception(error); } return true; }