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();