Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

load information with txt file to uwp c#

private async Task AddTextToFile(String textToSave)
{
    var appFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await appFolder.CreateFileAsync("exposure.txt", 
        Windows.Storage.CreationCollisionOption.OpenIfExists);
    await Windows.Storage.FileIO.AppendTextAsync(file, textToSave + Environment.NewLine);
    // Look in Output Window of Visual Studio for path to file
    System.Diagnostics.Debug.WriteLine(String.Format("File is located at {0}", file.Path.ToString()));
}

private async void Button_Click(object sender, RoutedEventArgs e)
{
    await AddTextToFile(String.Format("MinimumExposure {0}", DateTime.Now.Millisecond.ToString()));
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to iterate a generic list in c# 
Csharp :: caesar cipher in C# 
Csharp :: query parameters sending to controller action asp.net core 
Csharp :: c# decimal 4 casas decimais 
Csharp :: indexing an array 
Csharp :: do while loop in c# 
Csharp :: disable version header c# 
Csharp :: static constructor in c# 
Csharp :: c# read huge file 
Csharp :: how to check if button is pressed unity 
Csharp :: unity navmeshagent set destination 
Csharp :: how to insert data into multiple tables using asp.net c# 
Csharp :: color rgb to float c# 
Csharp :: c# anonymous type as return value 
Csharp :: declare prop array c# 
Csharp :: c# get all id of list object 
Csharp :: insert data to access database c# 
Csharp :: static initializer 
Csharp :: c# code examples 
Csharp :: How to create a class and objects in C# 
Csharp :: combined 2 arrays 
Csharp :: access denied tring to save a file uwp xamarin 
Csharp :: ioptions mock c# unittest 
Csharp :: How to build a rest component with very long process 
Csharp :: c# insert today datetime 
Csharp :: Code snipet for jump script unity 2d 
Csharp :: how to change the color of a textbox with button c# 
Csharp :: c# execute after delay 
Csharp :: How to change color of a column in RDLC report 
Csharp :: c# get error message from cmd command 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =