728x90
private void EnableWifi()
{
string networkSSID = "bbox-xxx";
string networkPass = "mypass";
WifiConfiguration wifiConfig = new WifiConfiguration();
wifiConfig.Ssid = string.Format("\"{0}\"", networkSSID);
wifiConfig.PreSharedKey = string.Format("\"{0}\"", networkPass);
WifiManager wifiManager = (WifiManager)Application.Context.GetSystemService(Context.WifiService);
// Use ID
int netId = wifiManager.AddNetwork(wifiConfig); wifiManager.Disconnect();
wifiManager.EnableNetwork(netId, true);
wifiManager.Reconnect();
}
참고
728x90
'C# > Xamarin Maui' 카테고리의 다른 글
(Xamarin Forms) 1.ContentPage (0) | 2017.06.29 |
---|---|
(Xamarin Forms) StartTimer (0) | 2017.06.22 |
(Xamarin.Android) splash screen 넣기 (0) | 2017.06.17 |
(Xamarin.Android) AdMob 광고 넣기 (2) (3) | 2017.06.15 |
(Xamarin.Android) AdMob 광고 넣기 (1) (0) | 2017.06.15 |