Solved

How to Extract gZip Base64 encoded Data

Posted on 2009-04-09
2
3,775 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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