winget install --id=ironfede.StructuredStorageXplorer -e
Microsoft Compound File .net component - pure C# - netstandard 2.0
Structured Storage Xplorer
Introduction:
Structured Storage Xplorer is a .NET/C# library designed to manipulate Compound File Binary Format (CFBF) files. It provides developers with tools to work with structured storage in various file formats, including Microsoft Office documents, Outlook messages, and more.
Key Features:
Audience & Benefit:
Ideal for developers, professionals, and organizations needing to manipulate structured storage files. It offers enhanced productivity by simplifying complex file operations, ensuring data integrity, and optimizing disk space usage.
Installation Note:
Structured Storage Xplorer can be installed via winget, providing a seamless setup experience.
This tool empowers users with robust capabilities for handling compound files efficiently, making it an essential resource for developers working with structured storage formats.
OpenMcdf is a fully .NET / C# library to manipulate Compound File Binary File Format files, also known as Structured Storage.
Compound files include multiple streams of information (document summary, user data) in a single container, and is used as the bases for many different file formats:
OpenMcdf v3 has a rewritten API and supports:
Limitations:
To create a new compound file:
byte[] b = new byte[10000];
using var root = RootStorage.Create("test.cfb");
using CfbStream stream = root.CreateStream("MyStream");
stream.Write(b, 0, b.Length);
To open an Excel workbook (.xls) and access its main data stream:
using var root = RootStorage.OpenRead("report.xls");
using CfbStream workbookStream = root.OpenStream("Workbook");
To create or delete storages and streams:
using var root = RootStorage.Create("test.cfb");
root.CreateStorage("MyStorage");
root.CreateStream("MyStream");
root.Delete("MyStream");
For transacted storages, changes can either be committed or reverted:
using var root = RootStorage.Create("test.cfb", StorageModeFlags.Transacted);
root.Commit();
//
root.Revert();
A root storage can be consolidated to reduce its on-disk size:
root.Flush(consolidate: true);
Support for reading and writing OLE Properties is available via the OpenMcdf.Ole package. However, the API is experimental and subject to change.
OlePropertiesContainer co = new(stream);
foreach (OleProperty prop in co.Properties)
{
...
}
OpenMcdf runs happily on the Mono platform and multi-targets netstandard2.0 and net8.0 to maximize client compatibility and support modern dotnet features.