-
StackOverflow 文件
-
Visual Basic .NET Language 教程
-
資料夾壓縮
-
動態建立 zip 存檔
' Create filestream to file
Using fileStream = New IO.FileStream("archive.zip", IO.FileMode.Create)
' open zip archive from stream
Using archive = New System.IO.Compression.ZipArchive(fileStream, IO.Compression.ZipArchiveMode.Create)
' create file_in_archive.txt in archive
Dim zipfile = archive.CreateEntry("file_in_archive.txt")
' write Hello world to file_in_archive.txt in archive
Using sw As New IO.StreamWriter(zipfile.Open())
sw.WriteLine("Hello world")
End Using
End Using
End Using