Results 1 to 4 of 4

Thread: vb.NET convert to PHP

  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.....

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: vb.NET convert to PHP

    not unless you rewrite it.

    what exactly is this piece of code supposed to be doing?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    310

    Re: vb.NET convert to PHP

    that will Xor my MD5 results
    VB 6.0 = "Self-Study" Then
    vb.NET = "Self-Study" Then
    C# = 'on going study.....

  4. #4
    Hyperactive Member tomcatexodus's Avatar
    Join Date
    Feb 2001
    Posts
    372

    Re: vb.NET convert to PHP

    If for only this function, then rewriting it would be optimal.

    However, if in the future you want to utilize large and cumbersome functions that would take far too much work to rewrite to PHP from VB, if you compile your functions into a library, you can access them from PHP via the COM Class. Unfortunately I haven't really explored this so I don't have much other information on it, but google reveals a number of tutorials and forum threads on it.
    Last edited by tomcatexodus; Aug 25th, 2010 at 12:31 PM.
    IWS

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