我想在Visual Studio中用C#處理XML,它不會允許我導入System.Xml。我查看了關於這個問題的其他帖子,這通常是由System.XML拼寫錯誤System.Xml引起的。我有正確的拼寫,所以我不確定是什麼導致我的問題。我看了下引用和沒有的System.Xml,我使用Visual Studio 2013中
Error 1 The type or namespace name 'Xml' does not exist in the namespace 'System' (are you missing an assembly reference?)
Visual Studio中的System.Xml不工作
我一定要下載的System.Xml錯誤信息?
下面是代碼
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace WebTesting
{
class Test1
{
public static void Main(string [] args)
{
using(XmlReader reader = XmlReader.Create("myData.Xml"))
{
while(reader.Reader())
{
if(reader.IsStartElement())
{
Console.Write("The start element is " + reader.ReadString());
}
}
}
Console.ReadLine();
}
}
}
請出示的代碼。 – OldProgrammer