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
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
Hemant KumarPosted Jan 23, 2015, 4:43 AM