zoukankan
html css js c++ java
压缩解压字符串
public
static
class
Zipper
{
public
static
string
Zip(
string
tozipstr)
{
MemoryStream mStream
=
new
MemoryStream();
GZipStream gStream
=
new
GZipStream(mStream, CompressionMode.Compress);
BinaryWriter bw
=
new
BinaryWriter(gStream);
bw.Write(Encoding.UTF8.GetBytes(tozipstr));
bw.Close();
gStream.Close();
string
outs
=
Convert.ToBase64String(mStream.ToArray());
mStream.Close();
return
outs;
}
public
static
string
UnZip(
string
zipedstr)
{
byte
[] data
=
Convert.FromBase64String(zipedstr);
MemoryStream mStream
=
new
MemoryStream(data);
GZipStream gStream
=
new
GZipStream(mStream, CompressionMode.Decompress);
StreamReader streamR
=
new
StreamReader(gStream);
string
outs
=
streamR.ReadToEnd();
mStream.Close();
gStream.Close();
streamR.Close();
return
outs;
}
}
查看全文
相关阅读:
材料用词积累
SqlServer 数据库/数据表 拆分(分布式)【转】
SqlServer 数据库读写分离【转】
(整理)在REHL6.5上部署ASP.NET MVC
(整理)MySQL_REHL6.5 安装MySQL5.5
(转)查看SQLServer最耗资源时间的SQL语句
(转)SQLServer查询数据库各种历史记录
(转)SqlServer2008 数据库同步:发布、订阅
(整理)SQL Server 2008 CDC 功能使用
(整理)EF分页的实现
原文地址:https://www.cnblogs.com/frogbag/p/1113084.html
最新文章
iview自定义列模板-手动实现可编辑表格
Uncaught TypeError: Converting circular structure to JSON
Cannot use v-for on stateful component root element because it renders multiple elements
利率参数校验
实际开发中webstrom常用快捷键
SQLserver2008使用表达式递归查询
WCF NetTcpBinding 由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作
VS2013 快捷方式
SQL中遇到多条相同内容只取一条的实现
C# 操作自定义config文件
热门文章
SqlServer2008 新建服务器对象->链接服务器脚本
由于出现操作系统错误 3,进程无法读取文件D:XXXXX.pre (源: MSSQL_REPL,错误号: MSSQL_REPL20024)
C# ??符号
Windows 系统定时自动重启
服务端端口状态解释
理解SQL【转http://blog.jobbole.com/55086/】
SOA的挑战:实体集合【转】
WCF:调用方未由服务器进行身份验证
LinuxCentos6安装MySql workbench
LinuxCentos6安装中文输入法
Copyright © 2011-2022 走看看