写xmlserializer serializer = new xmlserializer(typeof(purchaseorder)); textwriter writer = new streamwriter(filename);purchaseorder po=new purchaseorder();serializer.serialize(writer, po);writer.close();读xmlserializer serializer = new xmlserializer(typeof(purchaseorder));/* if the xml document has been altered with unknown nodes or attributes, handle them with the unknownnode and unknownattribute events.*/serializer.unknownnode+= new xmlnodeeventhandler(serializer_unknownnode);serializer.unknownattribute+= new xmlattributeeventhandler(serializer_unknownattribute);// a filestream is needed to read the xml document.filestream fs = new filestream(filename, filemode.open);// declare an object variable of the type to be deserialized.purchaseorder po;/* use the deserialize method to restore the objects state withdata from th... 下一页