vb.net从资源中提取zip

时间:2015-08-25 19:04:58

标签: vb.net

所以,我想从我的程序资源中使用dll提取一个zip文件,我正在使用Ionic库。

Dim a As Assembly = Assembly.GetExecutingAssembly()
        Dim zipFileStream As Stream = a.GetManifestResourceStream("My.Resources.file.zip")

        Using zip1 As ZipFile = ZipFile.Read(zipFileStream)
                Dim es As ZipEntry
                zip1.Password = "elissan69$"
            ' here, we extract every entry, bu1t we could extract conditionally,
            ' based on entry name, size, date, checkbox status, etc.   
            For Each entry As ZipEntry In zip1
                entry.Extract(UnpackDirectory, ExtractExistingFileAction.OverwriteSilently)
            Next
        End Using

我在zipfile.read上遇到错误..文件不能为NULL

0 个答案:

没有答案