Starting on my first Metro App and I’m hating this Async crap.
I have a JSON test file on my C: drive.
I’d like to read the file as a string without ASync and use it as my DataSource.
I’m having no luck.. It’s been 6 hours and I can’t even load this data.
Used FileOpenPicker but it uses Async for the PickSingleFileAsync()
Tried IsolatedStorage but they all use Async
Is there anything like Application.DoEvents I can use at the very least.
🙁
I need this type of function…
public string StringfromFile(string path)
{
using(FileStream fs = File.Open(path, FileMode.Open))using(StreamReader sr = new StreamReader(fs))
string data = sr.ReadToEnd();
return data;
}
I believe you have to use async, but if you want to run synchronously, you can do this