Link to home
Start Free TrialLog in
Avatar of ofern01
ofern01Flag for United States of America

asked on

How to Extract gZip Base64 encoded Data

VS2008
I have a File (xfdl) that is encoded base64 and compressed using gzip. When I open the File with Notepad I can read the first line.
application/vnd.xfdl;content-encoding="base64-gzip"
Is there a Lib (free if possible) that I can Use from VB.NET to gzip/gunzip Files? and Encode/Decode Base64?
Avatar of T0ni
T0ni

To gzip/gunzip (a free library):
http://www.icsharpcode.net/OpenSource/SharpZipLib/

To Encode/Decode Base64 (code below):


        public string Encode(string str)
        {
            byte[] encbuff = System.Text.Encoding.UTF8.GetBytes(str);
            return Convert.ToBase64String(encbuff);
        }
        public string Decode(string str)
        {
            byte[] decbuff = Convert.FromBase64String(str);
            return System.Text.Encoding.UTF8.GetString(decbuff);
        }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of T0ni
T0ni

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial