Good day to all.

Food program that archives the contents of a folder.

Problem:

"result.zip - file used by another process"

Code:

Dim startPath As String = "c:\example\start" Dim zipPath As String = "c:\example\result.zip" ZipFile.CreateFromDirectory(startPath, zipPath) 

Googled a solution to a similar problem through Thread. Stuck the code in the stream, but it did not help. Tell me where to look?

    1 answer 1

    Solved the problem by transferring the archive to another folder.

     Dim startPath As String = "c:\example\start" Dim zipPath As String = "c:\example2\result.zip" ZipFile.CreateFromDirectory(startPath, zipPath)