解析本地文件

时间:2013-05-04 10:16:22

标签: 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)
    {
        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();
    }

0 个答案:

没有答案