Solved

How to Extract gZip Base64 encoded Data

Posted on 2009-04-09
2
3,543 Views
Last Modified: 2013-12-17
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?
0
Comment
Question by:ofern01
  • 2
2 Comments
 
LVL 2

Expert Comment

by:T0ni
ID: 24106751
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

0
 
LVL 2

Accepted Solution

by:
T0ni earned 500 total points
ID: 24106979
Sorry thought I was in the C# section..
Here is the code to Encode/Decode Base64 in VB.NET:

    Public Function Encode(ByVal str As String) As String

        Dim encbuff As Byte() = System.Text.Encoding.UTF8.GetBytes(str)

        Return (Convert.ToBase64String(encbuff))

    End Function
 

    Public Function Decode(ByVal str As String) As String

        Dim decbuff As Byte() = Convert.FromBase64String(str)

        Return (System.Text.Encoding.UTF8.GetString(decbuff))

    End Function

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now