• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






笨笨在成长

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2011年12月16日

ZIP 方式压缩XML
摘要: public static string Compress(string uncompressedString) { byte[] byteData = Encoding.GetEncoding("GB18030").GetBytes(uncompressedString); using (MemoryStream srcStream = new MemoryStream(byteData)) { using (var destStream = new MemoryStream()) { using (GZipStream compress = new GZipStream 阅读全文
posted @ 2011-12-16 15:43 笨笨在成长 阅读(549) 评论(0) 推荐(0)
 
xml 序列化
摘要: using (var stream = new MemoryStream()) { using (var writer = new XmlTextWriter(stream, Encoding.GetEncoding("GB2312"))) { writer.Formatting = Formatting.Indented; writer.IndentChar = '\t'; var ns = new XmlSerializerNamespaces(); ns.Add(string.Empty, string.Empty); serializer.Seria 阅读全文
posted @ 2011-12-16 15:04 笨笨在成长 阅读(167) 评论(0) 推荐(0)