I’m programming a software using .NET FRAMEWORK 4.5 in METRO APPLICATIONS. I’m using the classes HttpClient and HttpResponseMessage to get the feeds from a RSS.
private async Task<IList<FeedDataItem>> CreateRecipesAndRecipeGroups(string url)
{
HttpClient client = new HttpClient();
HttpResponseMessage response = null;
try
{
response = await client.GetAsync(url);
}
catch (Exception ex)
{
// here I need to load the last feeds loaded
}
}
As you can see in my code, for example if I don’t have internet, the program should load the previous or latest feeds.
Does you have idea about how can I fix this scenario?
serialize the last downloaded feed to disk, when no internet available load from disk Quickstart: Reading and writing a file (Metro style apps using C#/VB/C++ and XAML)