Solved

How to Extract gZip Base64 encoded Data

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

18 Experts available now in Live!

Get 1:1 Help Now