public static class Canshu
{
public static int length = 90;
public static int width = 30;
}序列化:
string filename = Application.StartupPath + @"\canshu.xml";
XmlSerializer serializer =
new XmlSerializer(typeof(Canshu));
TextWriter writer = new StreamWriter(filename);
// Serialize the purchase order, and close the TextWriter.
serializer.Serialize(writer, SinLib.Canshu);//报错"SinLib.Canshu"是一个类型,这在给定的上下文中无效
writer.Close();
{
public static int length = 90;
public static int width = 30;
}序列化:
string filename = Application.StartupPath + @"\canshu.xml";
XmlSerializer serializer =
new XmlSerializer(typeof(Canshu));
TextWriter writer = new StreamWriter(filename);
// Serialize the purchase order, and close the TextWriter.
serializer.Serialize(writer, SinLib.Canshu);//报错"SinLib.Canshu"是一个类型,这在给定的上下文中无效
writer.Close();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货