Solved

.Net System.Convert.ToBase64String equivalent in VB6

Posted on 2004-09-06
8
2,303 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
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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 50

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 50

Author Comment

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

839 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