using SevenZip;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace Test
{
public static class ZipHelper
{
static bool Is64 = (IntPtr.Size == 8);
internal const string Name32 = "7z.dll";
internal const string Name64 = "7z64.dll";
internal const string ZIP_FILE = "index.zip";
static ZipHelper()
{
string name = Is64 ?Name64 : Name32;
SevenZip.SevenZipExtractor.SetLibraryPath(name);
}
public static Stream GetSteamFrom7z(string fileName)
{
var stream = new MemoryStream();
using (var tmp = new SevenZipExtractor(ZIP_FILE))
{
tmp.ExtractFile(fileName, stream);
}
stream.Position = 0;
return stream;
}
}
}
div>
Read More:
- Simple understanding and basic operation of mongodb
- The image operation of MATLAB — every detail operation of colorbar
- Solution to “550 create directory operation failed” in FTP operation file
- main.cpp : (. Text + 0xd06): undefined reference to XX method | simple record
- Simple use of namedparameterjdbctemplate of spring
- C language string processing error warning, c4996, sprintf, predicted, c4996, strcpy, c4996, strcat
- Simple solution for node sass installation failure
- Simple Python crawler exercise: News crawling on sohu.com
- Summary of OpenGL simple solar system simulation
- Spring boot thymeleaf crud implements simple functions of adding, deleting, modifying and querying
- Simple license plate recognition based on Halcon
- Simple configuration of glfw + glad in vs2015 OpenGL development environment
- To the brothers who encountered simple bind failed 192.168.1.×××: 636
- Python data cleaning — delete failed images__ Simple version
- How to empty a whole line in latex (simple and effective)
- C++:error C2228: left of ‘.str’ must have class/struct/union
- Solution to unbalanced load of multiple cards (GPU’s 0 card is too high) in Python model training (simple and effective)
- Differences between length() size() and C strlen() of C + + string member functions
- A simple method of generating secret key by GIT and configuring SSH public key
- Solve the problem of error: cannot pass objects of non trivially copyable type ‘STD:: String’ in C / C + +