第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Windows 10 IoT核心版以編程方式刪除WiFi配置文件

Windows 10 IoT核心版以編程方式刪除WiFi配置文件

C#
梵蒂岡之花 2021-04-04 12:55:52
我需要從代碼中刪除保存的wifi配置文件,以便再次啟用SoftAP。根據(jù)ms docs,無(wú)法刪除配置文件,只能斷開(kāi)連接。這不可能嗎?Ms的wifi文檔 https://docs.microsoft.com/zh-cn/uwp/api/windows.devices.wifi.wifiadapter設(shè)備門戶API https://docs.microsoft.com/de-ch/windows/mixed-reality/device-portal-api-reference#wifi-management但是對(duì)于刪除wifi配置文件,我從API中找不到404。根據(jù)上面鏈接的API文檔,該請(qǐng)求應(yīng)該可以。這是我刪除wifi配置文件的代碼        // API creds        string username = "Administrator";        string password = "p@ssw0rd        // API request URIs        string apiUri = "http://192.168.1.15:8080/api/wifi/network";        // WiFi details        string wifiInterface = string.Empty;        string wifiProfile = string.Empty;        // WiFi access        WiFiAccessStatus wifiAccess = await WiFiAdapter.RequestAccessAsync();        if (wifiAccess == WiFiAccessStatus.Allowed)        {            // Get WiFi adapter            IReadOnlyList<WiFiAdapter> wifiAdapterResult = await WiFiAdapter.FindAllAdaptersAsync();            WiFiAdapter wifiAdapter = wifiAdapterResult[0];            // Get conn profile / details            ConnectionProfile profile = await wifiAdapter.NetworkAdapter.GetConnectedProfileAsync();            wifiInterface = profile.NetworkAdapter.NetworkAdapterId.ToString();            wifiProfile = profile.ProfileName;        }        // API creds        PasswordCredential credentials = new PasswordCredential("login", username, password);        // HttpClient filter        HttpBaseProtocolFilter filter = new HttpBaseProtocolFilter();        filter.CookieUsageBehavior = HttpCookieUsageBehavior.NoCookies;        filter.CacheControl.ReadBehavior = HttpCacheReadBehavior.MostRecent;        filter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache;        filter.ServerCredential = credentials;要解決此問(wèn)題,自內(nèi)部版本17763起,有一種新方法可直接從可用代碼中刪除WiFi配置文件bool canDelete = wifiProfile.CanDelete;if (canDelete){     ConnectionProfileDeleteStatus deleteStatus = await wifiProfile.TryDeleteAsync();}
查看完整描述

3 回答

?
HUH函數(shù)

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超4個(gè)贊

最近一直在使用Windows設(shè)備門戶API,并且遇到了這篇文章。您的代碼得到404響應(yīng)的原因是因?yàn)樵贏PI URI中,&profile=期望的是Base64值,而不是您使用的文本字符串。將配置文件名稱編碼為Base64后,它應(yīng)該可以使用。

我相信這在MS的設(shè)備門戶文檔中沒(méi)有明確說(shuō)明,因?yàn)槲抑皇窃趧h除WIFI配置文件時(shí)使用Web瀏覽器調(diào)試器檢查Windows Device Portal網(wǎng)頁(yè)發(fā)現(xiàn)了這一點(diǎn)。


查看完整回答
反對(duì) 回復(fù) 2021-04-17
  • 3 回答
  • 0 關(guān)注
  • 211 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)