当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: 写XmlSerializer serializer = new
 

 

    摘要:c#操作xml初步(5)第二章:往现有xml文件添加记录另外c#又提供了一个更方便的方式让我们操作xml,那就是dataset其实我们可以这样认为,dataset其实就是多个xml文件,通过dataset一些内置的方法和属性操作xml,非常灵活我们继续假设,现有一个xml文件,如下: <?xml version="1.0" encoding="gb2312&qu......
 ·用.net创建windows服务     »显示摘要«
    摘要:我们将研究如何创建一个作为windows服务的应用程序。内容包含什么是windows服务,如何创建、安装和调试它们。会用到system.serviceprocess.servicebase命名空间的类。什么是windows服务?windows服务应用程序是一种需要长期运行的应用程序,它对于服务器环境特别适合。它没有用户界面,并且也不会产生任何可视输出。任何用户消息都会被写进windows事件日志。......


使用XmlSerializer 进行xml序列化

写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
...   下一页

    摘要: #region 声明 //---------------------------------------------------------------------- // // 修改: 李淼(nick.lee) // // datagrid在页面拖动行(在表头,用htc文件实现) // 时间:2005-04-23 // boyorgril@msn.com // boyor......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE