0

I have this code which extract a file in C#. Let say my zip filename is ABC.zip.

ZipFile.ExtractToDirectory(_downloadPath + zipFileName, _extractPath, true);

My question is how do I get the filename after the extraction? For example, filename is ABC.xml. How do I get this ABC.xml after the above code?

Steve
  • 2,963
  • 15
  • 61
  • 133
  • 4
    Either check the files in the destination directory afterward (e.g., `Directory.GetFiles(_extractPath)`) or use `ZipFile.Open()` which returns a `ZipArchive` that you can check its entries. – 41686d6564 stands w. Palestine May 11 '21 at 02:25
  • 1
    Does this answer your question? [How to get only filenames within a directory using c#?](https://stackoverflow.com/questions/7140081/how-to-get-only-filenames-within-a-directory-using-c) & [Getting all file names from a folder using C#](https://stackoverflow.com/questions/14877237/getting-all-file-names-from-a-folder-using-c-sharp) & [How do I get the directory from a file's full path?](https://stackoverflow.com/questions/674479/how-do-i-get-the-directory-from-a-files-full-path) –  May 11 '21 at 05:23

0 Answers0