简体   繁体   English

如何在 windows8 Store 应用程序中使用 XmlTextWriter?

[英]How to use XmlTextWriter in windows8 Store app?

I'm creating a windows store application in Visual Studio 2012 for Windows 8. I need to use the XmlTextWriter to write my output.我正在为 Windows 8 在 Visual Studio 2012 中创建一个 Windows 商店应用程序。我需要使用XmlTextWriter来编写我的输出。 I included the namespace我包括了命名空间

using System.Xml;

But the class is still not found.但是仍然没有找到该类。 Can someone tell me how to use the XmlTextWriter in a Windows 8 Metro application?有人能告诉我如何在 Windows 8 Metro 应用程序中使用XmlTextWriter吗?

I'm Creating an windows store application in Visual studio 2012 in windows 8. I need to use the XmlTextWriter to write the output.我正在 Windows 8 中的 Visual Studio 2012 中创建 Windows 商店应用程序。我需要使用 XmlTextWriter 来编写输出。

You cannot use XmlTextWriter within a Windows Store application.您不能在 Windows 应用商店应用程序中使用 XmlTextWriter。 You must use the XmlWriter class instead.您必须改用XmlWriter类。 In the future if a class does not list itself as supporting .NET for Windows Store apps then it cannot be used within an application being targeted to the Windows Store.将来,如果某个类不将自身列为支持 Windows 应用商店应用程序的 .NET,则它不能在面向 Windows 应用商店的应用程序中使用。

Since XmlWriter is an abstract class it basically means you will have to recreate the XmlTextWriter class.由于 XmlWriter 是一个抽象类,因此基本上意味着您必须重新创建XmlTextWriter类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM