C# 7-zip 压缩和解压缩
2021-01-04 10:29
标签:多个 color win nbsp var text new create unzip C# 7-zip 压缩和解压缩 标签:多个 color win nbsp var text new create unzip 原文地址:https://www.cnblogs.com/netlock/p/13194507.htmlusing System;
using System.Collections.Generic;
using System.Text;
using SevenZip;
using System.IO;
using System.Windows.Forms;
namespace TestZip
{
internal static class Zip
{
public static bool Init()
{
string _7z32 = Application.StartupPath+ "\\7z32.dll";
string _7z64 = Application.StartupPath + "\\7z64.dll";
string _7z = _7z32;
try
{
if (IntPtr.Size == 8)
_7z = _7z64;
SevenZipExtractor.SetLibraryPath(_7z);
SevenZipCompressor.SetLibraryPath(_7z);
return true;
}
catch
{
return false;
}
}
///