|
-
Aug 7th, 2010, 11:00 AM
#1
Thread Starter
Hyperactive Member
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:
Dim valuearray As Byte() = New Byte(3) {}
Dim s As String = myMD5res
Dim rx As New Regex("\w{2}")
Dim mc As MatchCollection = rx.Matches(s)
Dim sb As New StringBuilder()
Dim n As Integer = mc.Count / 4
For i As Integer = 0 To n - 1
For j As Integer = 0 To n - 1
valuearray(j) = Convert.ToByte(mc(i + (j * n)).Value, 16)
Next
Dim value As Integer = valuearray(0) Xor valuearray(1) Xor valuearray(2) Xor valuearray(3)
sb.Append(value.ToString("X2"))
Next
Dim hex32 As String = sb.ToString()
Dim myCodes As Integer = ("&H" & hex32 And &H1FFFFFF) Or &H2000000
Dim newCodes As String = myCodes.ToString("X2")
Dim hexNumber As [String] = newCodes
Dim hextodecs As Integer = Int32.Parse(hexNumber, NumberStyles.HexNumber)
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.....
-
Aug 7th, 2010, 06:51 PM
#2
Re: vb.NET convert to PHP
not unless you rewrite it.
what exactly is this piece of code supposed to be doing?
-
Aug 7th, 2010, 07:16 PM
#3
Thread Starter
Hyperactive Member
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.....
-
Aug 25th, 2010, 12:27 PM
#4
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|