为什么我在写作时出错:使用系统.IO压缩文件系统



我试图用需要using system.IO.Compression.FileType的siple方法zipfile解压缩一个文件,但我总是收到一个错误,没有这样的东西。

对于那些认为我使用的是无支持的。NET Framework,我使用的是4.5.2版本ZipFile应该与4.5版本及更高版本一起使用(正如Microsft所说)。

如有任何帮助,我们将不胜感激。

代码:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.IO.Compression;
// using System.IO.Compression.FileSystem;
private void InstallData()
{
pBar_Downloading.Style = ProgressBarStyle.Marquee;
if (updater_main.AppLang == "cz")
{
lbl_text.Text = "Právě probíhá instalace aktualizace...";
}
else
{
lbl_text.Text = "Installing the update...";
}
ZipFile.ExtractToDirectory(updater_main.AppLocation + "package.zip", updater_main.AppLocation);
}

正如您所说,您已经在使用4.5.2版本。

转到参考并添加"System.IO.Compression.FileSystem">

在Visual C#中添加引用

1。在解决方案资源管理器中,右键单击项目节点,然后单击"添加引用"。

2。在"添加参照"对话框中,选择指示要参照的零部件类型的选项卡。

3。选择要引用的组件,然后单击"确定"。

最新更新