Ejemplo n.º 1
0
        private async void Button_Click_3(object sender, RoutedEventArgs e)
        {
            RemoteTaskManager.UserName = UserNameText.Text;
            RemoteTaskManager.Password = PasswordText.Password;

            var vault = new Windows.Security.Credentials.PasswordVault();

            vault.Add(new Windows.Security.Credentials.PasswordCredential(
                          resourceName, RemoteTaskManager.UserName, RemoteTaskManager.Password));

            await RemoteTaskManager.Login();

            RemoteTaskManager.GetUsers(OnGetUsersCompleted);

            ((TaskListViewModel)DataContext).BeginUpdate();
        }
Ejemplo n.º 2
0
        private void HandleSave(object sender, EventArgs e)
        {
            RemoteTaskManager.UserName = UsernameText.Text;
            RemoteTaskManager.Password = PasswordText.Password;
            string pin = RemoteTaskManager.UserName + "|" + RemoteTaskManager.Password;

            // Convert the PIN to a byte[].
            byte[] PinByte = Encoding.UTF8.GetBytes(pin);

            // Encrypt the PIN by using the Protect() method.
            byte[] ProtectedPinByte = ProtectedData.Protect(PinByte, null);

            // Store the encrypted PIN in isolated storage.
            this.WritePinToFile(ProtectedPinByte);

            RemoteTaskManager.Login();

            NavigationService.GoBack();
        }