ラブびあ

ビール。ときどきラブ

dzip

ICSharpCode.SharpZipLib.dll
 
Imports System.IO
Imports ICSharpCode.SharpZipLib.Zip
Module Main
    Sub Main(ByVal args() As String)
        If args.Length = 0 Then
            Console.WriteLine("dzip.exe [-debug] [source directory]")
            Console.WriteLine("    dzip.exe makes zipfile with command-line-argument.")
            Environment.Exit(0)
        End If
 
        Try
            Dim debug As Boolean = False
 
            For Each arg As String In args
                If "-debug".Equals(arg) Then
                    debug = True
                    Continue For
                End If
 
                If Directory.Exists(arg) Then
                    Dim fz As New FastZip
                    Dim password As String = System.Configuration.ConfigurationManager.AppSettings.Item("password")
                    Dim srcpath As String = arg
                    Dim zipfile As String = arg & ".zip"
 
                    fz.Password = password
                    fz.CreateZip(zipfile, srcpath, True, "", "")
                    If debug Then
                        Console.WriteLine("[source directory]" & srcpath)
                        Console.WriteLine("[zip filename]" & zipfile)
                    End If
                Else
                    Console.WriteLine("[error! source directory not exists]" & arg)
                End If
            Next
 
            Environment.Exit(0)
        Catch ex As Exception
 
            Environment.Exit(9)
        End Try
    End Sub
End Module

cf.ICSharpCode.SharpZipLib.dll

http://www.icsharpcode.net/OpenSource/SharpZipLib/