Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 23:51

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



C#. Unzip a .7z file

Discussion on C#. Unzip a .7z file within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2008
Posts: 266
Received Thanks: 96
C#. Unzip a .7z file

Hi all.
i need a dll or a code to unzip .7z file.

Tnx
theoners is offline  
Old 12/28/2012, 00:48   #2
 
Mindrex's Avatar
 
elite*gold: 5
Join Date: Jun 2008
Posts: 89
Received Thanks: 136
7-Zip provides a SDK:
Code Example:
PHP Code:
private static void CompressFileLZMA(string inFilestring outFile)
    {
        
SevenZip.Compression.LZMA.Encoder coder = new SevenZip.Compression.LZMA.Encoder();
        
FileStream input = new FileStream(inFileFileMode.Open);
        
FileStream output = new FileStream(outFileFileMode.Create);

        
// Write the encoder properties
        
coder.WriteCoderProperties(output);

        
// Write the decompressed file size.
        
output.Write(BitConverter.GetBytes(input.Length), 08);

        
// Encode the file.
        
coder.Code(inputoutputinput.Length, -1null);
        
output.Flush();
        
output.Close();
    }

    private static 
void DecompressFileLZMA(string inFilestring outFile)
    {
        
SevenZip.Compression.LZMA.Decoder coder = new SevenZip.Compression.LZMA.Decoder();
        
FileStream input = new FileStream(inFileFileMode.Open);
        
FileStream output = new FileStream(outFileFileMode.Create);

        
// Read the decoder properties
        
byte[] properties = new byte[5];
        
input.Read(properties05);

        
// Read in the decompress file size.
        
byte [] fileLengthBytes = new byte[8];
        
input.Read(fileLengthBytes08);
        
long fileLength BitConverter.ToInt64(fileLengthBytes0);

        
coder.SetDecoderProperties(properties);
        
coder.Code(inputoutputinput.LengthfileLengthnull);
        
output.Flush();
        
output.Close();
    } 
Mindrex is offline  
Thanks
1 User
Old 12/28/2012, 02:13   #3
 
elite*gold: 0
Join Date: Oct 2008
Posts: 266
Received Thanks: 96
tnx for reply.

How can i use that to extract a .7z file?
theoners is offline  
Reply


Similar Threads Similar Threads
anyone post here the file of editing file.. the .edf file
07/13/2013 - RF Online - 3 Replies
please post here... so that i can download again.. i guess the old one thread was gone.. i've been search for an hour in this section.. but i can't see it... thanks..
Unzip problem
12/01/2012 - .NET Languages - 0 Replies
Hey, ich bin es mal wieder mit einem Problem Ich habe im Internet diese Klasse hier gefunden. Imports Shell32 Imports System Imports System.IO
How to Unzip the Rappelz Models
06/11/2011 - Rappelz - 4 Replies
Hey there ;) I'm actually trying to get the Rappelz Client Archives Unzipped so I can start playin around with the whole client and maybe make some new weapons ect. But I googled 2 hours now and didn't found anything.. any help?



All times are GMT +1. The time now is 23:51.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.