• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2337
  • Last Modified:

.Net System.Convert.ToBase64String equivalent in VB6

Hi,

I'm not quite sure what is equivalent to .Net System.Convert.ToBase64String function in VB6. See function below.

How to convert the below to VB6 version? thks


// Convert the read file input into Base64 encoded output

public static string FileToBase64(string fileName)
{
      byte[] binaryData;
      System.IO.FileStream inputFileName = new System.IO.FileStream(fileName,
                        System.IO.FileMode.Open, System.IO.FileAccess.Read);
      binaryData = new Byte[inputFileName.Length];
      inputFileName.Close();
      return System.Convert.ToBase64String(binaryData, 0, binaryData.Length);
}
0
Ryan Chong
Asked:
Ryan Chong
4 Solutions
 
vnvkCommented:
As far as I am aware, this is not supported directly in VB
0
 
vnvkCommented:
Many Datatypes supportedin .NET are not supported in VB6. But, then you can write custom functions or procedures to get the same. I need to work on it before giving u solution. If anyone elase gives it, thats great.
0
 
GrahamSkanCommented:
It's like converting to Hex which is base 16, but to base 64.
In the same way that Hex has to use letters to represent digits, so does Base 64.

But, as I understand it, the sequence doesn't start with 0 to 9 and then extend with letters, but just starts with A=0, B=1 up to Z = 25. Then come the lower case letters, then the 10 digiits and finally + and /.

I'm sure that with that information a person of your calibre can code an equivalent in VB6
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
mladenoviczCommented:
There is base64 activex dll here: http://www.sevillaonline.com/ActiveX/Base64.htm
It is free and works fine
0
 
gregoryyoungCommented:
0
 
Ryan ChongAuthor Commented:
Thks guys for the info, i will explore the links provided and let you guys know soon ;-) cheers
0
 
Ryan ChongAuthor Commented:
Thks guys for the links, they tested working
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now