3
Answers

How to read json file locally in c#

JOHN JOHNNNY

JOHN JOHNNNY

9y
7.6k
1

Hi

I am developing wp8 devotional app my questions are

1. How can i write a code to read the json/text file for each day's devotional locally

This is my code below

xaml

<ScrollViewer>
<TextBlock x:Name="textblock" TextWrapping="Wrap" Foreground="White"/>
</ScrollViewer>

xaml.cs

protected override void OnNavigatedTo(NavigationEventArgs e)
{

AddDevotions();
int index = DateTime.Now.DayOfYear;
textblock.Text = devotions[index];
}

List<String> devotions = new List<string>();
private void AddDevotions()
{

devotions.Add("4 Faith works miracles");
devotions.Add("5 Faith works miracles");
devotions.Add("6 Faith works miracles");
devotions.Add("7 Faith works miracles");
devotions.Add("8 Faith works miracles");
devotions.Add("9 Faith works miracles");
devotions.Add("10 Faith works miracles");



// add 366 days
}

Thank you in advance and reply soon

Answers (3)