Ionic.Utils.Zip.ZipFile-未定义 [英] Ionic.Utils.Zip.ZipFile - Not defined

查看:76
本文介绍了Ionic.Utils.Zip.ZipFile-未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
首先,我要感谢pimb2提出了一种自动更新应用程序的方法....
我正在尝试执行将自动将新编译的应用程序的文件复制到旧版本的操作...



但是我的问题是我得到的错误类型"Ionic.Utils.Zip.ZipFile"未定义


你能帮我吗?......?

下面给出的是我的代码.....


hi guys ,
First of all let me thank pimb2 for putting forth a method for auto update of applications.......
i was trying to do the same which automatically copy the files of the newly compiled application to the old version......



but my problem is i am getting the error Type ''Ionic.Utils.Zip.ZipFile'' is not defined


can u help me guys.......?

Given below is my code .....


Public Function CheckForUpdates(ByVal Location As String)
        Dim temppath = IIf(Environ$("tmp") <> "", Environ$("tmp"), Environ$("temp")) 'Get temp path

        Dim rand = Int((10000 - 1 + 1) * Rnd()) + 1 'Generate random number to have an unique filename

        Dim dldname = Path.GetFileName("N:\Deployment\PYRAMID") 'Get filename of file to be downloaded

        DownloadFileWithProgress("N:\Deployment\PYRAMID", temppath.ToString + "\" + rand.ToString + dldname) 'Download the file

        Dim a = New Ionic.Utils.Zip.ZipFile(temppath.ToString + "\" + rand.ToString + dldname) 'Create new var with zip file
        For Each zipfile As Ionic.Utils.Zip.ZipEntry In a 'for each loop for every file in zip
            If My.Computer.FileSystem.FileExists(vars_unzipdir + "\" + zipfile.PYRAMID) Then 'If this file already exist, delete it
                My.Computer.FileSystem.DeleteFile(vars_unzipdir + "\" + zipfile.PYRAMID)
            End If
            zipfile.Extract(vars_unzipdir) 'Extract this file
        Next
        Return Nothing
    End Function

推荐答案

(" )<> " ,环境
("tmp") <> "", Environ


( tmp"),环境


( )))' 获取温度路径 Dim rand = Int((( 10000 - 1 + 1 )* Rnd())+ 1 ' 生成随机数以具有唯一的文件名 Dim dldname = Path.GetFileName(" )获取要下载文件的文件名 DownloadFileWithProgress(" ,temppath.ToString + \" + rand.ToString + dldname)下载文件 Dim a = Ionic.Utils.Zip.ZipFile(temppath.ToString + \" + rand.ToString + dldname)使用zip文件创建新的变量 对于 每个 zip文件 As Ionic.Utils. Zip.ZipEntry 中为每个文件的每个循环' zip 如果 My.Computer.FileSystem.FileExists(vars_unzipdir + " + zipfile.PYRAMID)' 如果此文件已经存在,请将其删除 My.Computer.FileSystem.DeleteFile(vars_unzipdir + " + zipfile.PYRAMID) 结束 如果 zipfile.Extract(vars_unzipdir)' 提取此文件 下一步 返回 什么都没有 结束 功能
("temp")) 'Get temp path Dim rand = Int((10000 - 1 + 1) * Rnd()) + 1 'Generate random number to have an unique filename Dim dldname = Path.GetFileName("N:\Deployment\PYRAMID") 'Get filename of file to be downloaded DownloadFileWithProgress("N:\Deployment\PYRAMID", temppath.ToString + "\" + rand.ToString + dldname) 'Download the file Dim a = New Ionic.Utils.Zip.ZipFile(temppath.ToString + "\" + rand.ToString + dldname) 'Create new var with zip file For Each zipfile As Ionic.Utils.Zip.ZipEntry In a 'for each loop for every file in zip If My.Computer.FileSystem.FileExists(vars_unzipdir + "\" + zipfile.PYRAMID) Then 'If this file already exist, delete it My.Computer.FileSystem.DeleteFile(vars_unzipdir + "\" + zipfile.PYRAMID) End If zipfile.Extract(vars_unzipdir) 'Extract this file Next Return Nothing End Function


这篇关于Ionic.Utils.Zip.ZipFile-未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆