In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces you about the common sense of VS2003 compression code, the content is very detailed, interested friends can refer to, hope to be helpful to you.
1. First download the 0.84 version of VS2003 compression code and sample code from here.
2. After downloading it, you find that it doesn't have a VS2003 solution file, it doesn't matter. You can create your own, first create a new ZipUnzip solution, and then COPY all the unzipped files and directories above to the same directory as your solution.
Microsoft employees are concerned about Visual Studio2003 code editing
A few minutes to let you know the match of Visual Studio Boost.
It strongly shows that the relevant skills of Visual Studio debugging are the same as those of
Download and install the annoying Visual Studio 2005 SP1
Visual Studio 2010 develops and deploys 64-bit programs
3, in VS2003 solution Explorer (usually in the upper right middle point of the location), click the Show all files button, and then you can see a lot of "virtual" icons, files and folders, etc., you can select them at once, and then include them in the project.
4. Compile, * use the Release option. After compilation is complete, you can see the ZipUnzip.dll class in\ bin\ Release\. If you make a mistake in compiling the Times and say something like AssemblyKeyFile, you can use the strong naming tool to create a new one, or you can add [assembly: AssemblyKeyFile (")] in AssemblyInfo.cs. Change it to: [assembly: AssemblyKeyFile (")] (not recommended).
5. Create a new WEBFORM project, add a reference to the ZipUnzip.dll class, and then add the following files and contents:
Using System; using System.IO; using ICSharpCode.SharpZipLib.Zip; using ICSharpCode.SharpZipLib.GZip; using ICSharpCode.SharpZipLib.BZip2; using ICSharpCode.SharpZipLib.Checksums; using ICSharpCode.SharpZipLib.Zip.Compression; using ICSharpCode.SharpZipLib.Zip.Compression.Streams; namespace WebZipUnzip {public class AttachmentUnZip {public AttachmentUnZip () {} public static void UpZip (string zipFile) {string [] FileProperties=new string [2]; FileProperties [0] = zipFile / / File to be unzipped FileProperties [1] = zipFile.Substring (0ZipFile.LastIndexOf ("\") + 1); / / Target directory UnZipClass UnZc=new UnZipClass (); UnZc.UnZip (FileProperties) }} / /-/ / 2. UnZipClass.cs / /-using System; using System.IO; using ICSharpCode.SharpZipLib.Zip Using ICSharpCode.SharpZipLib.GZip; using ICSharpCode.SharpZipLib.BZip2; using ICSharpCode.SharpZipLib.Checksums; using ICSharpCode.SharpZipLib.Zip.Compression; using ICSharpCode.SharpZipLib.Zip.Compression.Streams Namespace WebZipUnzip {public class UnZipClass {/ unzipped file / contains the file name to extract and the directory name array public void UnZip (string [] args) {ZipInputStream s = new ZipInputStream (File.OpenRead (args [0])); try {ZipEntry theEntry While ((theEntry = s.GetNextEntry ())! = null) {string directoryName = Path.GetDirectoryName (args [1]); string fileName = Path.GetFileName (theEntry.Name); / / generate the extracted directory Directory.CreateDirectory (directoryName); if (fileName! = String.Empty) {/ / extract the files to the specified directory FileStream streamWriter = File.Create (args [1] + fileName); int size = 2048; byte [] data = new byte [2048] While (true) {ssize = s.Read (data, 0, data.Length); if (size > 0) {streamWriter.Write (data, 0, size);} else {break;}} streamWriter.Close ();}} s.Close ();} catch (Exception eu) {throw eu;} finally {s.Close () } / / end UnZip public static bool UnZipFile (string file, string dir) {try {if (! Directory.Exists (dir)) Directory.CreateDirectory (dir); string fileFullName = Path.Combine (dir,file); ZipInputStream s = new ZipInputStream (File.OpenRead (fileFullName)); ZipEntry theEntry; while ((theEntry = s.GetNextEntry ())! = null) {string directoryName = Path.GetDirectoryName (theEntry.Name); string fileName = Path.GetFileName (theEntry.Name) If (directoryName! = String.Empty) Directory.CreateDirectory (Path.Combine (dir, directoryName)); if (fileName! = String.Empty) {FileStream streamWriter = File.Create (Path.Combine (dir,theEntry.Name)); int size = 2048; byte [] data = new byte [2048]; while (true) {ssize = s.Read (data, 0, data.Length); if (size > 0) {streamWriter.Write (data, 0, size) } else {break;}} streamWriter.Close ();}} s.Close (); return true;} catch (Exception) {throw;} / end UnZipClass} what common sense about VS2003 compression code is shared here, hope that the above content can be helpful to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.