[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Do you know how to write C# code to use Shell32 to unzip a file? I am using .Net Framework 4.0

Posted on 2016-08-31
3
Medium Priority
?
171 Views
Last Modified: 2016-09-09
I am developing a C# application using VS2010 and .Net Framework 4.0

Do you know how to write C# code to use Shell32 to unzip a file ?

For ex:

let's assume I have a directory C:\TIFFILES   and in this directory,
I have a zipfile that of course has the file extension *.zip

and I want to unzip this file in this same folder C:\TIFFILES


------------

            const string TARGET_DIR_IN = @"\\C:\TIFFILES";
            string zipFilePath = Path.Combine(TARGET_DIR_IN, "???.zip");
                                             
            Shell32.Shell objShell = new Shell32.Shell();
            Shell32.Folder destinationFolder = objShell.NameSpace(TARGET_DIR_IN);
            Shell32.Folder sourceFile = objShell.NameSpace(zipFilePath);
0
Comment
Question by:zimmer9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:sunilgohel
ID: 41779231
please try below code to unzip file

expand MyFile.zip myFile

Open in new window

0
 
LVL 6

Expert Comment

by:pritaeas
ID: 41779653
I've found an article that might help.
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 41779724
instead of using shell, there are some built-in features in .Net: http://emoreau.com/Entries/Articles/2008/08/Introducing-SystemIOPackaging.aspx
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question