sharpziplib

How do I extract zip file in Windows Phone 7?

泄露秘密 提交于 2019-12-07 13:02:57
问题 I have a zip file in my Windows Phone 7 project. I have set the Build Action to Content and Copy to output directory to Always. The zip file contains the folder structure. I want this to be copied entirely as it is in my Phone Project. I am using SharpZipLib for this. This is the code :- Stream stremInfo = Application.GetResourceStream(new Uri("xip.zip", UriKind.Relative)).Stream; new FastZip(). ExtractZip(stremInfo, "",FastZip.Overwrite.Always,null,null,null,true,true); However I get error

Which compression type should i choose in SharpZipLib?

本秂侑毒 提交于 2019-12-07 05:06:19
问题 I have a File Transfer Application that sends files and folders. (Server - client) I am trying to send data over TCP (sockets), I've made some rules for the way of transferring the data, so if it's sending a large folder that has many files, it should compress them into a single zip file first then when that zip file sent, the receiver has to decompress it. so I have decided to use SharpZibLib and I have got a question about it. Which type of compressing should i choose for my application? I

How do you add a folder to a zip archive with ICSharpCode.SharpZipLib

折月煮酒 提交于 2019-12-07 02:57:48
问题 I have to create two folders inside of a zip file that I create programmatically using ICSharpCode.SharZipLib.Zip . I want to: private void AddToZipStream(byte[] inputStream, ZipOutputStream zipStream, string fileName, string fileExtension) { var courseName = RemoveSpecialCharacters(fileName); var m_Bytes = inputStream; if ((m_Bytes != null) && (zipStream != null)) { var newEntry = new ZipEntry(ZipEntry.CleanName(string.Concat(courseName, fileExtension))); newEntry.DateTime = DateTime.Now;

ICSharpCode.SharpZipLib validate zip file

让人想犯罪 __ 提交于 2019-12-07 00:15:17
问题 Using ICSharpCode.SharpZipLib for C#, how can I validate that the file being passed is actually a valid zip file (not something that has been right clicked and renamed as .zip)? [HttpPost] public ActionResult Upload(HttpPostedFileBase fileData) { if (fileData != null && fileData.ContentLength > 0) { if (Path.GetExtension(fileData.FileName) == ".zip") { var zipFile = Server.MapPath("~/Content/uploads/" + Path.GetFileName(fileData.FileName)); fileData.SaveAs(zipFile); FileStream fs = System.IO

Renaming ICSharpCode.SharpZipLib.dll

喜夏-厌秋 提交于 2019-12-06 16:39:21
well I am having a problem renaming the ICSharpCode.SharpZipLib.dll file to anythig else. I am trying to shorten the file name. I reference the assembly in the project, but when the program reaches the statements where I use the library. It spawns an error that it could not find the assembly or file 'ICSharpCode.SharpZipLib'. When I change the file name back to ICSharpCode.SharpZipLib.dll the application works noramally. So, is there any way to change the file name. Also, am I allowed to change it without violating the license (I am going to use it in a commercial application). Thanks. You

How do I extract zip file in Windows Phone 7?

允我心安 提交于 2019-12-05 23:05:32
I have a zip file in my Windows Phone 7 project. I have set the Build Action to Content and Copy to output directory to Always. The zip file contains the folder structure. I want this to be copied entirely as it is in my Phone Project. I am using SharpZipLib for this. This is the code :- Stream stremInfo = Application.GetResourceStream(new Uri("xip.zip", UriKind.Relative)).Stream; new FastZip(). ExtractZip(stremInfo, "",FastZip.Overwrite.Always,null,null,null,true,true); However I get error when ExractZip is called. The exception I get is " MethodAccessException ". Cannot call GetFullPath() .

SharpLibZip: Add file without path

落爺英雄遲暮 提交于 2019-12-05 15:02:30
问题 I'm using the following code, using the SharpZipLib library, to add files to a .zip file, but each file is being stored with its full path. I need to only store the file, in the 'root' of the .zip file. string[] files = Directory.GetFiles(folderPath); using (ZipFile zipFile = ZipFile.Create(zipFilePath)) { zipFile.BeginUpdate(); foreach (string file in files) { zipFile.Add(file); } zipFile.CommitUpdate(); } I can't find anything about an option for this in the supplied documentation. As this

DLL versioning error

旧街凉风 提交于 2019-12-05 12:15:51
问题 I've got a web site that sporadically throws the following error: Server Error in '/' Application. Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=0.85.3.365, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Now I know that I do have a dependency on this DLL, but I have version 0.85.5 on my system. I have systematically deleted

How do you add a folder to a zip archive with ICSharpCode.SharpZipLib

痴心易碎 提交于 2019-12-05 08:17:46
I have to create two folders inside of a zip file that I create programmatically using ICSharpCode.SharZipLib.Zip . I want to: private void AddToZipStream(byte[] inputStream, ZipOutputStream zipStream, string fileName, string fileExtension) { var courseName = RemoveSpecialCharacters(fileName); var m_Bytes = inputStream; if ((m_Bytes != null) && (zipStream != null)) { var newEntry = new ZipEntry(ZipEntry.CleanName(string.Concat(courseName, fileExtension))); newEntry.DateTime = DateTime.Now; newEntry.Size = m_Bytes.Length; zipStream.PutNextEntry(newEntry); zipStream.Write(m_Bytes, 0, m_Bytes

Add files to ZIP without paths, using SharpZipLib

回眸只為那壹抹淺笑 提交于 2019-12-04 23:36:11
I need to combine 3 files into 1 zip file and make it available to download for the user. I am able to achieve my requirement except one thing: it zips the files into the subfolders. For example, my files are located like the following: C:\TTCG\WebSites\Health\ABC.CSV C:\TTCG\WebSites\Health\XYZ.CSV C:\TTCG\WebSites\Health\123.CSV But in the zip file, it zip the files in the folder by using "TTCG\WebSites\Health\" as the path. Please see the attach file. I don't want the folders in the path. I just want 3 files in the zip file without folders. How can I achieve that? My codes to generate the