Reputation: 10499
I need to set a static IP address of a device with Windows 10 mobile. I am developing an Universal Windows App (UWP).
How can I do?
I tried following this article: https://blogs.msdn.microsoft.com/softwaresimian/2014/09/10/setting-an-ip-to-address-to-be-static-and-then-dynamic-in-c/
But some of the classes are missing (like ManagementClass).
Upvotes: 1
Views: 767
Reputation: 2361
UWP applications are made to run in a sandbox. You won't have access to any APIs that change system settings or anything that could potentially change the behaviour of another application. At most you could have the application open the connection settings UI but it would be up to the user to perform actual changes.
The code that you reference should run in a WPF application or a console application. If you want to launch the Wi-Fi settings dialog you can use the following.
bool result = await Launcher.LaunchUriAsync(new Uri("ms-settings:network-wifi"));
Upvotes: 1