Exemplo n.º 1
0
        public int Unzip(ref string sZipFileName = "", ref string sExtractDir = "")
        {
            int functionReturnValue = 0;

            // ERROR: Not supported in C#: OnErrorStatement


            int lRet = 0;

            if (Strings.Len(sZipFileName) > 0)
            {
                msZipFileName = sZipFileName;
            }

            if (Strings.Len(sExtractDir) > 0)
            {
                msExtractDir = sExtractDir;
            }


            lRet = CodeModule.VBUnzip(ref msZipFileName, ref msExtractDir, ref miExtractNewer, ref miSpaceUnderScore, ref miPromptOverwrite, ref Convert.ToInt16(miQuiet), ref miWriteStdOut, ref miTestZip, ref Convert.ToInt16(miExtractList), ref miExtractOnlyNewer,
                                      ref miDisplayComment, ref miHonorDirectories, ref miOverWriteFiles, ref miConvertCR_CRLF, ref miVerbose, ref miCaseSensitivity, ref Convert.ToInt16(miPrivilege));

            functionReturnValue = lRet;
            return(functionReturnValue);

vbErrorHandler:


            Err().Raise(Err().Number, "CGUnZipFiles::Unzip", Err().Description);
            return(functionReturnValue);
        }
Exemplo n.º 2
0
        public int MakeZipFile()
        {
            int functionReturnValue = 0;
            //UPGRADE_WARNING: Arrays in structure zFileArray may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
            ZIPnames zFileArray  = default(ZIPnames);
            object   sFileName   = null;
            int      lFileCount  = 0;
            short    iIgnorePath = 0;
            short    iRecurse    = 0;

            // ERROR: Not supported in C#: OnErrorStatement



            lFileCount = 0;

            foreach (object sFileName_loopVariable in mCollection)
            {
                sFileName = sFileName_loopVariable;
                //UPGRADE_WARNING: Couldn't resolve default property of object sFileName. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                zFileArray.s(lFileCount) = sFileName;
                lFileCount = lFileCount + 1;
            }


            functionReturnValue = CodeModule.VBZip(Convert.ToInt16(lFileCount), msZipFileName, zFileArray, iIgnorePath, miRecurseFolders, miUpdateZip, 0, msRootDirectory);
            return(functionReturnValue);

vbErrorHandler:



            functionReturnValue = -99;
            Err().Raise(Err().Number, "CGZipFiles::MakeZipFile", Err().Description);
            return(functionReturnValue);
        }