private void WifiPasswardInputWindow_Comfirmed(object sender, EventArgs e) { if (sender is WifiPasswardInputWindow wifiInfoWindow) { var wlanInfoItem = wifiInfoWindow.WlanInfoItem; var connectSuccess = WlanService.ConnectToWlan(wlanInfoItem, wifiInfoWindow.Password, wifiInfoWindow.IsAutoConnect, out var errorMsg); if (!connectSuccess) { MessageBox.Show(errorMsg); } } }