Solved

.Net System.Convert.ToBase64String equivalent in VB6

Posted on 2004-09-06
8
2,290 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
 
LVL 34

Assisted Solution

by:flavo
flavo earned 25 total points
ID: 11994359
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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 49

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 49

Author Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now