using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;using System.Diagnostics;
using System.IO;public partial class Zip : System.Web.UI.Page
{protected void Page_Load(object sender, EventArgs e){}//压缩文件protected void Button1_Click(object sender, EventArgs e){ProcessStartInfo startinfo = new ProcessStartInfo();...
项目上用到的,随手做个记录,哈哈。直接上代码: 1using System;2using System.Data;3using System.Configuration;4using System.Collections.Generic;5using System.IO;6using ICSharpCode.SharpZipLib.Zip;7using ICSharpCode.SharpZipLib.Checksums;8namespace BLL9{10///<summary> 11/// 文件(夹)压缩、解压缩 12///</summary> 13publicclass FileCompression14 {15#region 压缩文件16///<summary> 17/// 压缩文件 18...
DotNetZipLib类库的地址:http://dotnetzip.codeplex.com/650) this.width=650;" title="01.png" src="/upload/getfiles/default/2022/11/10/20221110092749875.jpg" />将压缩包解压引用 : 650) this.width=650;" title="02.png" src="/upload/getfiles/default/2022/11/10/20221110092750332.jpg" />注意:以下所有代码都是控制台应用程序先来一个测试(生成一个压缩包):using System;
using System.Collections.Generic;
usin...
Atitit. 解压缩zip文件 的实现最佳实践 java c# .net php 1. Jdk zip 跟apache ant zip 1 2. Apache Ant包进行ZIP文件压缩,upzip 大概流程.. 1 3. 读文件名称ok,但是cant读取到input说NPE.. 2 4. Ant1.8.2.jar 2 5. #---详细code 2 6. 参考 4 1. Jdk zip 跟apache ant zip 下面实现的功能是zip文件中的图像文件解压到当前目录下,用jdk自带的处理zip文件的代码处理的,但是不能处理中文名称的文件,要不...
using System;
using System.IO;
using System.Diagnostics;
using Microsoft.Win32;
using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Zip;namespace AutoUpdate.Helper
{public class SharpZip{public SharpZip(){ }/// <summary>/// 压缩/// </summary> /// <param name="filename"> 压缩后的文件名(包含物理路径)</param>/// <param name="directory">待压缩的文件夹(包含物理路径)</param>public sta...
SharpZipLib: recursively zip/unzip directory structure 001 // Project: Salient 002 // http://salient.codeplex.com 003 // 004 // Copyright 2010, Sky Sanders <sky at skysanders.net> 005 // Dual licensed under the MIT or GPL Version 2 licenses. 006 // http://salient.codeplex.com/license 007 //? 008 // Date: May 24 2010 009 ? 010 #region 011 ? 012 using System; 013 using System.Collectio...
/// <summary> /// 解压缩文件(压缩文件中含有子目录) /// </summary> /// <param name="zipfilepath">待解压缩的文件路径</param> /// <param name="unzippath">解压缩到指定目录</param> /// <returns>解压后的文件列表</returns> public List<string> UnZip(string zipfilepath, string unzippath){//解压出来的文件列表 List<string> unzipFiles = new List<string>();//检查输出目录是否以“\\”结尾 if (unzippath.E...
我有一个C#回复服务器,可以打包一个对象并将其发送到请求者C#客户端.我可以做同样的事情,但是使用C#答复服务器与C请求者客户端进行通信吗?
这是我的C#回复服务器的示例:using System;
using System.Text;
using ZMQ;
using MsgPack;namespace zmqMpRep
{public class Weather{public int zipcode;public int temperature;public int humidity;}public class zmqMpRep{public static void Main(string[] args){Socket replier = ...
我想从一个zip文件中读取一个二进制文件而不将其解压缩.
压缩文件结构:zipFolderName/subFolder/BinFile在BinFile中,我有:Id1, id2, value1 // id1, id2 are string, value1 is int在C#中:ZipEntry binFileName = …; // it has been got from zipFile entriesMemoryStream ms = new MemoryStream();binFileName.Extract(ms);using (BinaryReader reader = new BinaryReader(ms))
{string id1 = reader.ReadString(); // error...
1 /// <summary>2 /// 压缩文件 FNameArry 为客户端传回来的文件列表:文件名数组,压缩包的名称strZipName3 /// </summary>4 /// <param name="FNameArry">文件名数组</param>5 /// <param name="strZipName">压缩包的名称</param>6 public void ZipFile(string[] FNameArry string strZipName)7 {8 9 10 if (strZipName.Length != 0) //压缩包名称不为空1...
我有一些字符串,我需要在C#中压缩服务器端,然后在JavaScript中解压缩客户端.我可以用什么来完成这个?解决方法:假设您通过HTTP获取此数据,是否有任何理由不能在HTTP级别执行此操作? (见this article for information about HTTP compression.)
这样,除了确保请求包含适当的Accept-Encoding标头之外,您不需要在客户端执行任何操作.根据您的服务器,您可能只需调整一些服务器设置即可自动获取压缩…
说实话,值得突破WireShark以确切地...
我使用lz-string.js的LZString.compressToBase64函数,需要解压缩/压缩服务器端的数据.
显而易见的解决方案似乎是lz_string_csharp,但我很担心
这个说法:If you use just the regular Javascript ‘compress’ function then depending on the data in the string, it will not decompress correctly on the C# side.
However, if you are using the ‘compress’ function built into this C# version, then you should be ok to ...
我一直在寻找一种解决方案,使用C#从.tgz或.tar.gz存档中读取一个或多个文件,而无需将文件解压缩到磁盘.
我已经确定了许多在GNU许可下发布的第三方库,允许某人提取.tgz存档但是没有任何运气找到解决方案来读取文件而不先提取它.
如果可能的话,我想坚持标准库 – 有没有人有使用GZipStream或任何其他方法的解决方案?谢谢!
编辑:
我想实现类似于以下内容:public static void Decompress2(FileInfo fileToDecompress)
{using (File...
我构建了(基于CodeProject文章)一个包装类(C#)来使用GZipStream来压缩MemoryStream.它压缩很好但不会减压.我看了很多其他有相同问题的例子,我觉得我跟着说的是什么,但是当我解压缩时仍然没什么.这是压缩和解压缩方法:public static byte[] Compress(byte[] bSource)
{using (MemoryStream ms = new MemoryStream()){using (GZipStream gzip = new GZipStream(ms, CompressionMode.Compress, true)){gzip.Write(bSource, 0, bSourc...
我正在尝试使用DotNetZip Library解压缩文件.
该文件包含带有丹麦字符的文件夹和文件().
TotalCommander,7Zip,Windows自带的zip都能正确提取文件,但DotNetZip Library会破坏丹麦文字.
例如:File_.txt变为File_¢.txt
它的内容包含一个¢.一个的内容包含一个.
码:using (var zipFile = ZipFile.Read(@"File_??????.zip"))
{zipFile.ExtractAll(@"File_??????",ExtractExistingFileAction.OverwriteSilently);
}我正在使用默认编码(“...