Ejemplo n.º 1
0
        /// <summary>
        /// 确定保存WiFi设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void SaveWiFiYes_Clicked(object sender, RoutedEventArgs e)
        {
            notification.Dismiss();
            if (data.wlanInfo == null)
            {
                return;
            }
            if (data.wlanInfo.wl0_ssid.Length == 0 || data.wlanInfo.wl1_ssid.Length == 0)
            {
                notification.Show(Utils.AppResources.GetString("NullSSID"));
                return;
            }
            if (data.wlanInfo.wl0_wpa_psk.Length == 0 || data.wlanInfo.wl1_wpa_psk.Length == 0)
            {
                notification.Show(Utils.AppResources.GetString("NullPassword"));
                return;
            }
            var res = await RouterAPI.SetWlan(data.wlanInfo);

            if (res)
            {
                notification.Show(Utils.AppResources.GetString("WiFiSetSuccess"));
            }
            else
            {
                notificationError.Show(Utils.AppResources.GetString("WiFiSetError"));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 确定保存WiFi设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void SaveWiFiYes_Clicked(object sender, RoutedEventArgs e)
        {
            notification.Dismiss();
            if (wlanInfo == null)
            {
                return;
            }
            if (wlanInfo.wl0_ssid.Length == 0 || wlanInfo.wl1_ssid.Length == 0)
            {
                notification.Show("请输入SSID");
                return;
            }
            if (wlanInfo.wl0_wpa_psk.Length == 0 || wlanInfo.wl1_wpa_psk.Length == 0)
            {
                notification.Show("请输入密码");
                return;
            }
            var res = await RouterAPI.SetWlan(wlanInfo);

            if (res)
            {
                notification.Show("WiFi设置保存成功");
            }
            else
            {
                notificationError.Show("WiFi设置保存失败");
            }
        }