Hi
Is there a way i can read my json file stored in my folder in the message box i have tried the with the code below but keeps getting error
//Message box code
List<string> strings = new List<string>() { "Friday 16Th 6PM", "Sunday 18TH 10AM & 7PM", "Wednesday 21st 6PM", "Friday 23RD 6PM", "Sunday 25th 10AM & 7PM", "Wednesday 28th 6PM", "Friday 30th 6PM", };
public ListPicker()
{
InitializeComponent();
lbx.ItemsSource = strings;
lbx.SelectionChanged += lbx_SelectionChanged;
}
void lbx_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
value = lbx.SelectedIndex;
switch (value)
{
case 0:MessageBox.Show("");
break;
case 1: MessageBox.Show("");
break;
case 2: MessageBox.Show(" ");
break;
case 3: MessageBox.Show(" ");
break;
case 4: MessageBox.Show(" ");
break;
case 5: MessageBox.Show("");
break;
}
}
public int value { get; set; }
//Json file reference code
string filepath = @"Assets\resources.json";
StorageFolder folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
StorageFile file = await folder.GetFileAsync(filepath); // error here
var data = await Windows.Storage.FileIO.ReadTextAsync(file);
Thank you in advance and reply soon