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

Read Project File in WinRT

1161 Views   
[TestMethod]
public void ProjectFileTest()
{
    ProjectFile();
}
 
private async void ProjectFile()
{
    // settings
    var _Path = @"Metro.Helpers.Tests\MyFolder\MyFolder.txt";
    var _Folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
 
    // acquire file
    var _File = await _Folder.GetFileAsync(_Path);
    Assert.IsNotNull(_File, "Acquire file");
 
    // read content
    var _ReadThis = await Windows.Storage.FileIO.ReadTextAsync(_File);
    Assert.AreEqual("Hello world!", _ReadThis, "Contents correct");
}
by Jerry Nixon
  June 29, 2012 @ 11:15am
Tags:

Add a comment


Report Abuse
brought to you by:
West Wind Techologies