-3
下面的代碼應該從控制檯的XML文件並顯示結果爲:我需要序列化的XML文件在C#
class Program
{
static void Main(string[] args)
{
Program introToVCS = new Program();
System.Xml.Serialization.XmlSerializer reader = new
System.Xml.Serialization.XmlSerializer(introToVCS.GetType());
// Read the XML file.
System.IO.StreamReader file =
new System.IO.StreamReader("Customer.xml");
// Deserialize the content of the file into a Program object.
introToVCS = (Program)reader.Deserialize(file);
Console.WriteLine(introToVCS);
Console.ReadLine();
}
}
你需要解釋什麼是錯的。 –
請問您可以發佈customer.xml文件嗎? – 2016-08-13 09:44:55
包含文件的路徑名。 – jdweng