Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB.Net to VB6 Conversion

Posted on 2013-01-05
2
Medium Priority
?
425 Views
Last Modified: 2013-01-05
Hi Experts,

Can anyone convert the following code to VB6?  

Private Function SHA256File(ByVal input As String) As String
        Dim rdr As FileStream
        Dim sha As New SHA256Managed
        Dim bytes() As Byte
        Dim output As String = ""
        If File.Exists(input) Then
            rdr = New FileStream(input, FileMode.Open, FileAccess.Read)
            bytes = sha.ComputeHash(rdr)
            For Each b As Byte In bytes
                output += b.ToString("x2")
            Next
        End If
        Return output
    End Function

Thanking you,
Soumen
0
Comment
Question by:Soumen-Roy
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 38747341
I think it would be easier to create a component (.dll) in .Net with this code and use it from VB6.
0
 

Author Closing Comment

by:Soumen-Roy
ID: 38748019
Thanx
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…
Suggested Courses

877 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