摘要:
System.IO.Compression 命名空间
注意:此命名空间在 .NET Framework 2.0 版中是新增的。
System.IO.Compression 命名空间包含提供基本的流压缩和解压缩服务的类。
压缩字符串
public static string ZipString(string unCompressedString)
{
byte[] bytData = System.Text.Encoding.UTF8.GetBytes(unCompressedString);
MemoryStream ms = new MemoryStream();
Stream s = new GZipStream(ms, CompressionMode.Compress);
s.Write(bytData, 0, bytData.Length);
s.Close();
byte[] compressedData = (byte[])ms.ToArr 阅读全文
摘要:
1、建立Conn.cs类文件
using System;
using System.Text;
using System.Web;
using System.IO;
namespace myservers
{
///
/// Conn 的摘要说明。
///
public class Conn
{
public Conn()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public string WriteFile(string strText,string strContent,string strAuthor)
{
s 阅读全文