Invoking the WiFi connections UI in Windows 10

2019-07-31 09: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