【问题标题】:connect to a wifi network with wlantool.exe in Compact 7 failed with 1814 error code在 Compact 7 中使用 wlantool.exe 连接到 wifi 网络失败,错误代码为 1814
【发布时间】:2018-05-04 06:14:10
【问题描述】:

从我在 Compact 7 中的命令提示符中,我尝试执行如下操作:

wlantool -c -ssid 名称 -auth wpa2psk -encr aes -key mypassword

我收到此错误: [WLANTOOL] WlanReasonCodeToString() FAILED 错误:1814

同一命令运行了将近 1 个月,突然返回此错误。

  • 网络名称 (SSID):名称
  • 加密:AES
  • 身份验证:WPA2-PSK
  • 网络密钥:我的密码

我在上面的命令提示符中做错了什么?以及如何找出错误 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;
    }

【问题讨论】:

标签: c++ windows-ce wifi wlanapi


【解决方案1】:

问题之所以发生,是因为 WINCE 限制为 66 个(不确定这个确切数量)可以创建的配置文件数量。当我从注册表手动删除之前创建的一些配置文件时,问题解决了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-11
    • 2017-05-07
    • 2017-08-21
    相关资源
    最近更新 更多