How to Extract PS File Using C#
In order to extract PS file, we’ll use
API which is a feature-rich, powerful and easy to use document decompression API for C# platform. Open
package manager, search for Aspose.ZIP and install. You may also use the following command from the Package Manager Console.
Command
PM> Install-Package Aspose.ZIP
Steps for PS Files Decompression in C#
Developers can easily extract zip archives with arbitrary content programmatically with just few lines of code.
- Define full path to the archive.
- Open this file as stream for reading.
- Create Object of Archive, using path to archive as constructor parameter.
- Using the Archive object, extract its content to destination folder using its ExtractToDirectory method.
- Now you will get archive content decompressed to destinantion folder.
System Requirements
Our APIs are supported on all major platforms and Operating Systems. Before executing the code below, please make sure that you have the following prerequisites on your system.
- Microsoft Windows or a compatible OS with .NET Framework, .NET Core
- Development environment like Microsoft Visual Studio
- Aspose.ZIP for .NET DLL referenced in your project - Install from NuGet using the Download button above
Extract PS Files - C#
// For complete examples and data files, please go to https://github.com/aspose-zip/Aspose.ZIP-for-.NET | |
using (FileStream zipFile = File.Open(dataDir + "CompressDirectory_out.zip", FileMode.Open)) | |
{ | |
using (var archive = new Archive(zipFile)) | |
{ | |
archive.ExtractToDirectory(dataDir + "DecompressFolder_out"); | |
} | |
} |
Online PS Decompression Live Demos
Extract PS documents right now by visiting our Live Demos website . The live demo has the following benefits
Other Supported Decompression Formats
Using C#, One can also decompress many other formats including.