SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Problem extracting files with windows extractor

Last post 11-14-2008 6:04 AM by rskumar. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-22-2007 4:58 AM

    Problem extracting files with windows extractor

    I am using the following code to create a zip file and I have installed the ICSharpCode.SharpZipLib.dll
    When trying to extract the files using windows extracter, I get a blocking error that says to bring up the properties of the zip folder and
    click on unblock. When this is done, the folder still won't open. I can extract the files using winzip! Can anyone enlighten me on what to do.
    And does someone have some VB.net code to creat a self-extracting file that contains zip files?

     

    Dim strmZipOutputStream As ZipOutputStream

    strmZipOutputStream = New ZipOutputStream(File.Create(strZipFileName))

    strmZipOutputStream.SetLevel(6)

    ' #######################

    ' Compression Level: 0-9

    ' 0: no(Compression)

    ' 9: maximum compression

    ' #######################

    Dim strFile As String

    For Each strFile In astrFileNames

    Dim strmFile As FileStream = File.OpenRead(strFile)

    Dim abyBuffer(strmFile.Length - 1) As Byte

    strmFile.Read(abyBuffer, 0, abyBuffer.Length)

    Dim objZipEntry As ZipEntry = New ZipEntry(strFile)

    objZipEntry.DateTime = DateTime.Now

    objZipEntry.Size = strmFile.Length

    strmFile.Close()

    'objCrc32.Reset()

    'objCrc32.Update(abyBuffer)

    'objZipEntry.Crc = objCrc32.Value

    strmZipOutputStream.PutNextEntry(objZipEntry)

    strmZipOutputStream.Write(abyBuffer, 0, abyBuffer.Length)

    Next

    strmZipOutputStream.Finish()

    strmZipOutputStream.Close()

     

  • 09-26-2007 8:41 PM In reply to

    Re: Problem extracting files with windows extractor

    Hi,

    When you create a ZipEntry use relative paths.  this is one cause of the cant see files in windows problem.

     There is a ZipNameTransform class that can help you to do this if you have hassles with it.

     

    hth, -jr- 

  • 11-14-2008 6:04 AM In reply to

    Re: Problem extracting files with windows extractor

     Hi,

     I try to Extract the.rar file used blow code. It throws the error.Give me solution to extract a tar using ICSharpCode.SharpZipLib DLL.

     

     public void ExtractFile()
        {
            String Archive = "";
            String DestinationFolder = "E:\\GRAB\\";

            GZipInputStream gZipStream = new GZipInputStream(File.OpenRead(@"E:\\Sen.rar"));
            //TarArchive ta = TarArchive.CreateInputTarArchive(gZipStream);
            TarInputStream ZipFile = new TarInputStream(gZipStream);
            //TarEntry ZipFileEntry = ZipFile.GetNextEntry();
            FileStream fs = new FileStream(DestinationFolder + "2.rar", FileMode.Create);

           // ZipFile.
            ZipFile.CopyEntryContents(fs);
            ZipFile.Close();
            ZipFile.Dispose();
            fs.Close();
            fs.Dispose();


        }

     

    Thanks,

    Sen

    Filed under:
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.