Results 1 to 4 of 4

Thread: vb.NET convert to PHP

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    310

    vb.NET convert to PHP

    Is there any good way to convert a vb.net code into PHP?
    Here is my code function that want to convert into php. Tia
    Xor function Code:
    1. Dim valuearray As Byte() = New Byte(3) {}
    2.         Dim s As String = myMD5res
    3.         Dim rx As New Regex("\w{2}")
    4.         Dim mc As MatchCollection = rx.Matches(s)
    5.         Dim sb As New StringBuilder()
    6.  
    7.         Dim n As Integer = mc.Count / 4
    8.         For i As Integer = 0 To n - 1
    9.             For j As Integer = 0 To n - 1
    10.                 valuearray(j) = Convert.ToByte(mc(i + (j * n)).Value, 16)
    11.             Next
    12.             Dim value As Integer = valuearray(0) Xor valuearray(1) Xor valuearray(2) Xor valuearray(3)
    13.  
    14.             sb.Append(value.ToString("X2"))
    15.         Next
    16.  
    17.         Dim hex32 As String = sb.ToString()
    18.         Dim myCodes As Integer = ("&H" & hex32 And &H1FFFFFF) Or &H2000000
    19.         Dim newCodes As String = myCodes.ToString("X2")
    20.  
    21.         Dim hexNumber As [String] = newCodes
    22.         Dim hextodecs As Integer = Int32.Parse(hexNumber, NumberStyles.HexNumber)
    23.         TextBox1.Text = hextodecs
    Last edited by dr_aybyd; Aug 7th, 2010 at 05:56 PM.
    VB 6.0 = "Self-Study" Then
    vb.NET = "Self-Study" Then
    C# = 'on going study.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width