VC++开发常用功能一系列文章 (欢迎订阅,持续更新...)
自动断开wifi,并删除相关wifi profile
profile 就是那个记住密码的功能,我们需要清除这个功能......
以前的文章写个怎么自动连接wifi功能,这一篇主要是怎么断开它.....
1. 连接
1)显示本机保存的profiles,配置文件是以wifi的ssid命名的.
netsh wlan show profiles
2)用netsh wlan connect name=xxxxx 连接其中一个profile
3)断开连接
netsh wlan disconnect
4)netsh wlan delete profile * 清除所有配置文件
直接上代码:
BOOL CITCFreeTouchDlg::SavewifiBat(CString wifiSSID)
{
USES_CONVERSION;
//