예제 #1
0
        private async void Done_Click(object sender, RoutedEventArgs e)
        {
            var resourceLoader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();

            if (otp_secret.Text == "")
            {
                err_text.Text = resourceLoader.GetString("err_empty_secret");
                scroll1.ChangeView(0, 0, 1);
            }
            else
            {
                try
                {
                    Base32Encoding.ToBytes(otp_secret.Text.Trim());
                    await SqlAccess.Add_Item(0, otp_issuer.Text, otp_label.Text, otp_secret.Text, otp_algorithm.SelectedIndex, (int)otp_digits.SelectedValue, (int)otp_period.SelectedValue, type, logo);

                    MainPage.mainPage.init_data();
                    back();
                }
                catch
                {
                    err_text.Text = resourceLoader.GetString("err_wrong_secret");
                    scroll1.ChangeView(0, 0, 1);
                }
            }
        }
예제 #2
0
        private async void Done_Click(object sender, RoutedEventArgs e)
        {
            var resourceLoader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();

            if (otp_secret.Text == "")
            {
                err_text.Text = resourceLoader.GetString("err_empty_steam_secret");
            }
            else
            {
                try
                {
                    Base32Encoding.ToBytes(otp_secret.Text);
                    await SqlAccess.Add_Item(1, "Steam", otp_label.Text, otp_secret.Text, 0, 5, 30, 1, "steam");

                    MainPage.mainPage.init_data();
                    back();
                }
                catch
                {
                    err_text.Text = resourceLoader.GetString("err_wrong_steam_secret");
                }
            }
        }