Invoking the WiFi connections UI in Windows 10

妖精的绣舞 提交于 2019-12-24 09:26:58

问题


Prior to Windows 10, the WiFi connections UI could be invoked via a ShellExecute using the appropriate GUIDs/strings, details of which can be fairly easily found on the web. This changed in Windows 10. Although there is an API which can be used to programmatically manage WiFi connections (Native WiFi), and there is even a C# wrapper for it on CodePlex, I'd have to build my own UI around it; I can't find any information on how to launch the existing Windows 10 UI for managing WiFi connections. I'd rather not have to build my own duplicate of functionality which already exists just because the existing functionality can't be invoked programmatically.

Is it not publicly exposed? If it is callable, how is it done? Is it just a different ShellExecute?


回答1:


The Uri for the available networks is ms-availablenetworks:

So just use this in your code:

var success = await Windows.System.Launcher.LaunchUriAsync(new Uri(@"ms-availablenetworks:"));




回答2:


Found this:

https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app

The listed URIs can be invoked via ShellExecute in a Win32 console app to successfully launch the appropriate dialogs.




回答3:


You could try running the command "%windir%\explorer.exe ms-availablenetworks:" . Alternatively, "Start ms-availablenetworks:" in command prompt.

I came across this on another post and seems like it should do what you're looking for. It hasn't worked for me but perhaps you'd have better luck.

There's plenty of other URIs available too. Here's the list I found: https://www.tenforums.com/tutorials/78108-app-commands-list-windows-10-a.html



来源:https://stackoverflow.com/questions/41148711/invoking-the-wifi-connections-ui-in-windows-10

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!