Win 7为防火墙添加一条规则
来源:互联网 发布:flash cs6 mac 破解版 编辑:程序博客网 时间:2024/05/21 06:43
代码如下,直接执行shell
TCHAR szModulePath[MAX_PATH] = {0};GetModuleFileName(GetModuleHandle(NULL), szModulePath, sizeof(szModulePath) / sizeof(TCHAR));string strParameters = "firewall add allowedprogram ";strParameters += szModulePath;strParameters += " udpSrv2 enable";SHELLEXECUTEINFO shellExecute = {0};shellExecute.cbSize = sizeof SHELLEXECUTEINFO;shellExecute.fMask = SEE_MASK_NOCLOSEPROCESS;shellExecute.lpFile = "netsh";shellExecute.lpParameters = strParameters.c_str();shellExecute.nShow = SW_HIDE;if (ShellExecuteEx(&shellExecute)){WaitForSingleObject(shellExecute.hProcess, 2000);CloseHandle(shellExecute.hProcess);}
这样在程序启动时候防火墙就不会拦截。
- Win 7为防火墙添加一条规则
- Windows XPE为NetMeeting添加防火墙规则
- iptables防火墙添加规则
- win 7 防火墙设置
- VC代码添加防火墙规则
- NSIS 添加防火墙规则实战
- centos 防火墙添加删除规则
- 添加为防火墙例外
- 为mac下的vpn连接添加一条静态路由规则
- Linux下如何添加防火墙规则
- CentOS 关闭SELINUX及添加防火墙规则
- dos 添加防火墙入站规则
- dos 添加防火墙入站规则
- 《批处理添加防火墙过滤危险端口规则》
- Win 7 防火墙无法启用解决方法
- Win 7 防火墙无法启用解决方法
- 给WIN 2003添加应用程序为服务
- FWR-610P 添加和删除一条路由规则源代码
- ffmpeg AVPacket & AVFrame
- EAS BOS生成EAS需要的id
- split 例子
- IE6 png 透明 (三种解决方法)
- certificate
- Win 7为防火墙添加一条规则
- python中的类
- android局域网通信(udp,tcp等)
- linux私房菜(基础篇2)
- 什么是函数嵌套和递归
- 利用ffmpeg来进行视频解码的完整示例代码(H.264)
- c++中char*\wchar_t*\string\wstring之间的相互转换
- 使用PinYin4j.jar将汉字转换为拼音
- PP 配置库位参与MRP运算 及物料主数据的相关设置