Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
why when i make call to the function , apper error in
TextBox2.Text = convBytesWords(m(), o, p)

VB
Public Class Form1
    Public Shared w As Integer = 32, r As Integer = 20
    Public Shared ReadOnly e As Double = Math.E
    Public Const goldenRatio As Double = 1.61803398874965
    Public Shared Pw As Integer = CInt(&HB7E15163), Qw As Integer = CInt(&H9E3779B9)
    Public Shared S As Integer()
    Public Shared Function convBytesWords(key As SByte(), u As Integer, c As Integer) As Integer()
        Dim i As Integer
        Dim tmp As Integer() = New Integer(c - 1) {}
        For i = 0 To tmp.Length - 1
            tmp(i) = 0
        Next
        i = 0
        Dim off As Integer = 0
        While i < c
            tmp(i) = ((key(System.Math.Max(System.Threading.Interlocked.Increment(off), off - 1)) And &HFF)) Or ((key(System.Math.Max(System.Threading.Interlocked.Increment(off), off - 1)) And &HFF) << 8) Or ((key(System.Math.Max(System.Threading.Interlocked.Increment(off), off - 1)) And &HFF) << 16) Or ((key(System.Math.Max(System.Threading.Interlocked.Increment(off), off - 1)) And &HFF) << 24)
            i += 1
        End While
        Return tmp
    End Function
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim m As Integer
        m = Val(TextBox1.Text)
        Dim o As Integer = 4
        Dim p As Integer = 4
        TextBox2.Text = convBytesWords(m(), o, p)
    End Sub
End Class
Posted
Updated 14-Nov-14 9:04am
v2

1 solution

Do you want something like: Encoding.GetString Method (Byte[], Int32, Int32) ?

http://msdn.microsoft.com/en-us/library/05cts4c3(v=vs.110).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900