从我在 Compact 7 中的命令提示符中,我尝试执行如下操作:
wlantool -c -ssid 名称 -auth wpa2psk -encr aes -key mypassword
我收到此错误:[WLANTOOL] WlanReasonCodeToString() FAILED 错误:1814
相同的命令运行了将近 1 个月,突然它返回了这个错误。
- 网络名称 (SSID):名称
- 加密:AES
- 认证:WPA2-PSK
- 网络密钥:mypassword
我在上面的命令提示符中做错了什么?以及如何找出错误 1814 是什么?
我想从 C# 程序调用命令行工具 wlantool.exe,让用户在我的应用程序中处理 wifi 连接。
WLANTOOL的c++代码
DWORD dwFlags = 0;
BOOL bOverwrite = TRUE;
DWORD dwReasonCode = WLAN_REASON_CODE_UNKNOWN;
dwError = WlanSetProfile(*phClientHandle,
&pInterface->InterfaceGuid,
0,
bstrXml,
NULL,
bOverwrite,
NULL,
&dwReasonCode);
if(ERROR_SUCCESS != dwError)
{
WCHAR strMeaning[MAX_PATH];
DWORD dwEr = ERROR_SUCCESS;
strMeaning[0] = L'\0';
dwEr = WlanReasonCodeToString(dwReasonCode,
MAX_PATH,
strMeaning,
NULL);
if(ERROR_SUCCESS != dwEr )
{
PrintMsg(L"WlanReasonCodeToString() FAILED error: %lu",dwEr);
break;
}
PrintMsg(L"WlanSetProfile() FAILED Error: %lu dwReasonCode : %lu Meaning : %s,",
dwError,
dwReasonCode,
strMeaning);
break;
}