Advertisement
calfred2808

Archive files Module

Jul 29th, 2018
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.57 KB | None | 0 0
  1. Imports System
  2. Imports System.IO
  3. Imports System.IO.Compression
  4. Imports System.IO.Compression.ZipFile
  5.  
  6.  
  7. Module CompressFilesMod
  8.     Public Sub ArchiveNow()
  9.         Try
  10.             Dim xSourcePath As String = "D:\1\files"
  11.             Dim xDesPath As String = "D:\1\files\"
  12.             Dim xZipName As String = "MyArchive.zip"
  13.  
  14.             Dim xFullDesPath As String = xDesPath + xZipName
  15.  
  16.             ZipFile.CreateFromDirectory(xSourcePath, xFullDesPath, CompressionLevel.Optimal, False)
  17.  
  18.         Catch ex As Exception
  19.  
  20.         End Try
  21.  
  22.     End Sub
  23. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement