private async System.Threading.Tasks.Task loginAsync(String email, String pass) { token = await this.loginService.LoginTask(email, pass); if (token != null) { await FilehanderService.WriteFile("token.txt", token); navigation.currentLayout.checkToken(); this.Frame.Navigate(typeof(MainPage)); progress1.IsActive = false; } else { loginfail.Text = "Invalid information, Please login again!"; progress1.IsActive = false; } }
private async void btn_write_Click(object sender, RoutedEventArgs e) { var savePicker = new Windows.Storage.Pickers.FileSavePicker(); savePicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary; //// Dropdown of file types the user can save the file as savePicker.FileTypeChoices.Add("Plain Text", new List <string>() { ".txt" }); //// Default file name if the user does not type one in or select a file to replace savePicker.SuggestedFileName = "New Document"; var file = await savePicker.PickSaveFileAsync(); if (file != null) { filename = txt_filename.Text; String content = txt_content.Text; FilehanderService.WriteFile(filename + ".txt", content); } }
private async void writeDataUser(String email, String pass) { await FilehanderService.WriteFile("email", email); await FilehanderService.WriteFile("pass", pass); }