我正在尝试在方法中声明变量。Unfourantly,无论我试图声明什么类型的变量,我都会收到错误“invalid expression term public”
public void SerializeToXML(List<amzReport> amzReport)
{
private String 4t4t;
XmlSerializer serializer = new XmlSerializer(typeof(List<amzReport>));
TextWriter textWriter = new StreamWriter(@"C:\movie.xml");
serializer.Serialize(textWriter, amzReport);
textWriter.Close();
}
更新代码(错误:“;预期”):
/********************************************************************************/
public void SerializeToXML(List<amzReport> amzReport)
{
String 4t4t;
XmlSerializer serializer = new XmlSerializer(typeof(List<amzReport>));
TextWriter textWriter = new StreamWriter(@"C:\movie.xml");
serializer.Serialize(textWriter, amzReport);
textWriter.Close();
}
/********************************************************************************/