0

خطای باز کردن فایل Zip در سی شارپ

سوال در مورد سی شارپ :

چرا این برنامه را می نویسم ارور میده (کار با زیپ در سی شارپ )

using System;
using System.IO;
using System.IO.Compression;

namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            string startPath = @"c:\example\start";
            string zipPath = @"c:\example\result.zip";
            string extractPath = @"c:\example\extract";

            ZipFile.CreateFromDirectory(startPath, zipPath);

            ZipFile.ExtractToDirectory(zipPath, extractPath);
        }
    }
}

زیر ZipFile خط قرمز میکشه

پرسیده شده در 1395/12/13 توسط

1 پاسخ

1

سلام دوست عزیز، برای استفاده از کلاس ZipFile باید داخل پروژه به System.IO.Compression.FileSystem حتماً Reference بدید، در غیر اینصورت نمیتونید از این کلاس استفاده کنید.

پاسخ در 1395/12/13 توسط

پاسخ شما