Solved

How to Extract gZip Base64 encoded Data

Posted on 2009-04-09
2
3,897 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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