Solved

.Net System.Convert.ToBase64String equivalent in VB6

Posted on 2004-09-06
8
2,309 Views
Last Modified: 2013-11-25
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
Comment
Question by:Ryan Chong
[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
8 Comments
 
LVL 7

Expert Comment

by:vnvk
ID: 11994160
As far as I am aware, this is not supported directly in VB
0
 
LVL 7

Expert Comment

by:vnvk
ID: 11994179
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
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 25 total points
ID: 11994211
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 34

Assisted Solution

by:flavo
flavo earned 25 total points
ID: 11994359
0
 
LVL 8

Assisted Solution

by:mladenovicz
mladenovicz earned 100 total points
ID: 11995757
There is base64 activex dll here: http://www.sevillaonline.com/ActiveX/Base64.htm
It is free and works fine
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 100 total points
ID: 11997911
0
 
LVL 52

Author Comment

by:Ryan Chong
ID: 12002458
Thks guys for the info, i will explore the links provided and let you guys know soon ;-) cheers
0
 
LVL 52

Author Comment

by:Ryan Chong
ID: 12040734
Thks guys for the links, they tested working
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

729 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