Jump to content

VB.Net to AutoIt


Recommended Posts

Hello, I was wonderingif someone could help me to port some code form VB.NET to Autoit. I've never programmed inn VB:NET, and I really ried to understood that function, but I haven't managed yet, so I'm asking your help, please.

Here is the code that I wish to port to AutoIT:

Private Function generating(ByVal str1 As Object, ByVal str2 As Object) As String
    Dim objectValue As Object = Math.Floor(CDbl((CDbl(Conversions.ToInteger(NewLateBinding.LateGet(str2, Nothing, "Length", New Object(0  - 1) {}, Nothing, Nothing, Nothing))) / 2)))
    Dim arguments As Object() = New Object() { 0, RuntimeHelpers.GetObjectValue(objectValue) }
    Dim copyBack As Boolean() = New Boolean() { False, True }
    If copyBack(1) Then
        objectValue = RuntimeHelpers.GetObjectValue(arguments(1))
    End If
    Dim obj3 As Object = Operators.AddObject(Operators.AddObject(NewLateBinding.LateGet(str2, Nothing, "Substring", arguments, Nothing, Nothing, copyBack), str1), Strings.Mid(Conversions.ToString(str2), Conversions.ToInteger(Operators.AddObject(objectValue, 1)), Strings.Len(RuntimeHelpers.GetObjectValue(str2))))
    Return Me.MD5(Conversions.ToString(obj3))
End Function

And here is the MD5 function, just in case you need it:

Public Function MD5(ByVal number As String) As String
    Dim str2 As String
    Dim bytes As Byte() = New ASCIIEncoding().GetBytes(number)
    Dim provider As New MD5CryptoServiceProvider
    Dim num As Byte
    For Each num In provider.ComputeHash(bytes)
        str2 = (str2 & num.ToString("x2"))
    Next
    Return str2
End Function

Please help me because I need it! Thank you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...