10

Can I find some open source library for accessing (reading only is ok) OLE Storage like doc or xls files in c#?

Rohit
  • 3,610
  • 7
  • 45
  • 76
  • I assume it's present in the today's .NET Framework: https://msdn.microsoft.com/en-us/library/system.io.packaging.storageinfo(v=vs.110).aspx – Vlad Jun 19 '16 at 12:41

3 Answers3

20

You can use my open source (MPL) library OpenMCDF for a 100% .net implementation of COM structured storage. A sample COM structured storage file viewer is also available as a usage sample of the library.

ironfede
  • 221
  • 2
  • 5
7

An excellent article describes the usage.

COM structured storage from .NET

Rohit
  • 3,610
  • 7
  • 45
  • 76
2

OleDbConnection can handle structured storage as long as the appropriate OLE DB driver is installed on the machine your app is running on.

Excel:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsx;
    Extended Properties="Excel 12.0 Xml;HDR=YES";

Text:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\txtFilesFolder\;
    Extended Properties="text;HDR=Yes;FMT=Delimited";

ConnectionStrings.com has a whole host of other Data Sources that you can access via OLE with the built-in libraries.

Justin Niessner
  • 242,243
  • 40
  • 408
  • 536