.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);
}
LVL 56
Ryan ChongAsked:
Who is Participating?
 
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
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
GrahamSkanConnect With a Mentor RetiredCommented:
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
 
mladenoviczConnect With a Mentor Commented:
There is base64 activex dll here: http://www.sevillaonline.com/ActiveX/Base64.htm
It is free and works fine
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.