Solved

VB.Net to VB6 Conversion

Posted on 2013-01-05
2
422 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
[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
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

617 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