TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
JOHN JOHNNNY
NA
190
139.7k
Reading json file from folder
Jan 16 2015 7:59 AM
Hi
I am having challenges with the code below the error sown is "MainPage.ReadJsonFile(String):not all code parts return value"
//JSON starts here
public string ReadJsonFile(string JsonfilePath)
{
using (StreamReader r = new StreamReader("Dec1.js"))
{
string json = r.ReadToEnd();
dynamic array = JsonConvert.DeserializeObject(json);
//... read text from json file
return string text
}
}
//Daily Devotion starts here
protected override void OnNavigatedTo(NavigationEventArgs e)
{
AddDevotions();
int index = DateTime.Now.DayOfYear;
textblock.Text = devotions[index];
}
List devotions = new List();
private void AddDevotions()
{
devotions.Add(ReadJsonFile("Assets/Dec1.js"));
devotions.Add(ReadJsonFile("Assets/Dec2.js"));
devotions.Add(ReadJsonFile("Assets/Dec3.js"));
//...for 365 days
}
Reply soon
Reply
Answers (
1
)
add data in datagridview without delete old data
Help with JSON file reading