C# 解析本地文件
我想从本地文件(.txt)解析,我得到了这个。有人能帮忙吗 我使用Visual Studio 2012并使用网格模板制作win8应用程序 mscorlib.dll中发生类型为“System.exception”的未处理异常 WinRT信息:位置1063处的字符无效 其他信息:无效的JSON字符串 App.xaml.cs:C# 解析本地文件,c#,json,parsing,visual-studio-2012,windows-store-apps,C#,Json,Parsing,Visual Studio 2012,Windows Store Apps,我想从本地文件(.txt)解析,我得到了这个。有人能帮忙吗 我使用Visual Studio 2012并使用网格模板制作win8应用程序 mscorlib.dll中发生类型为“System.exception”的未处理异常 WinRT信息:位置1063处的字符无效 其他信息:无效的JSON字符串 App.xaml.cs: protected override async void OnLaunched(LaunchActivatedEventArgs args) {
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();
}
您发布的代码似乎与您的问题完全无关。当您导航到GroupedItemsPage时,它会做什么?我在尝试调试时了解到这一点,但designer GroupedItemsPage看起来很不错,但没有显示项目。。错误列表很清楚..System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw 00000000 push esi 00000001 mov esi,ecx 00000003 mov ecx,dword ptr[esi+4]00000006 mov edx,esi 00000008 cmp dword ptr[ecx],ecx 0000000 A呼叫FF98289C 0000000 F mov ecx,dword ptr[esi+4]00000012根据错误调用FF888908 00000017 int 3“.txt.7文件包含JSON字符串?你觉得怎么样?你能展示一些代码吗?您是否检查过您的文件(位置1063)?