'How to programmatically read xml file inside cab file

Is there any way for me to read contents of an xml file in a cab file in C#? I know how to use XDocument to load an xml file and read its contents, but not sure if it is possible to read an xml file that is zipped up in a cab file.

Any ideas?



Solution 1:[1]

What you are looking to do is to extract the contents of the CAB file first. You can either write the code to do that yourself or use a 3rd party library.

I have not used this personally, but I have seen it mentioned several times on this site and others: http://www.codeproject.com/KB/files/CABCompressExtract.aspx

To take a stab at writing it yourself, refer to the documentation here: http://msdn.microsoft.com/en-us/library/cc483132%28EXCHG.80%29.aspx

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 gmiley