CodePaste Logo
New Snippet New Recent Snippets Recent Snippets My Snippets My Snippets My Favorites Favorites Web Code Search Snippets Search
Sign inor Register
Language: csharp

Read Project File in WinRT

2241 Views   
[TestMethod] public void ProjectFileTest() { ProjectFile(); } private async void ProjectFile() { // settings // same as (ms-appx:///MyFolder/MyFile.txt) var _Folder = Windows.ApplicationModel.Package.Current.InstalledLocation; _Folder = await _Folder.GetFolderAsync("MyFolder"); // acquire file var _File = await _Folder.GetFileAsync("MyFile.txt"); Assert.IsNotNull(_File, "Acquire File"); // write content var _WriteThis = "Hello World"; await Windows.Storage.FileIO.WriteTextAsync(_File, _WriteThis); // read content var _ReadThis = await Windows.Storage.FileIO.ReadTextAsync(_File); Assert.AreEqual(_WriteThis, _ReadThis, "Contents correct"); }
by Jerry Nixon
  June 29, 2012 @ 11:15am
Tags:
by Jerry Nixon    June 03, 2013 @ 11:44am

Updated June 2013

Add a comment


Report Abuse
brought to you by:
West Wind Techologies