我想从本地文件(.txt)中解析,我明白了。有人可以帮忙吗?
我使用 Visual Studio 2012 并使用 Grid 模板制作 win8 应用程序。
mscorlib.dll 中出现“System.Exception”类型的未处理异常
WinRT 信息:位置 1063 处的字符无效。
附加信息:无效的 JSON 字符串。
应用程序.xaml.cs:
protected override async void OnLaunched(LaunchActivatedEventArgs args)
{
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
//Associate the frame with a SuspensionManager key
SuspensionManager.RegisterFrame(rootFrame, "AppFrame");
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// Restore the saved session state only when appropriate
try
{
await SuspensionManager.RestoreAsync();
}
catch (SuspensionManagerException)
{
}
}
if (args.PreviousExecutionState == ApplicationExecutionState.Running)
{
Window.Current.Activate();
}
await VitsitDataSource.LoadLocalDataAsync();
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
if (!rootFrame.Navigate(typeof(GroupedItemsPage), "AllGroups"))
{
throw new Exception("Failed to create initial page");
}
}
// Ensure the current window is active
Window.Current.Activate();
}