Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
PHP - da vb a php
Forum - PHP - da vb a php

Avatar
andriy88 (Ex-Member)
Pro


Messaggi: 118
Iscritto: 04/11/2005

Segnala al moderatore
Postato alle 22:05
Mercoledė, 16/11/2005
Qualcuno mi pu? trasformare questo codice VB a PHP?? PLS. ? urgente....



Public Function LockToKey(lck As String) As String
  Dim h As Integer, j As Integer, n As Integer
  n = 5
  h = InStr(1, lck, " ")
  If h Then lck = Left$(lck, h - 1)
  h = Asc(lck) Xor Asc(Right$(lck, 1)) Xor Asc(Right$(lck, 2)) Xor n
  h = (h \ 16) Xor (h * 16)
  Do While h > 255
    h = h - 256
  Loop
  Select Case h
    Case 0, 5, 36, 96, 124, 126
      LockToKey = "/%DCN" & Right$("00" & CStr(h), 3) & "%/"
    Case Else
      LockToKey = Chr$(h)
  End Select
  For j = 2 To Len(lck)
    h = Asc(Mid$(lck, j, 1)) Xor Asc(Mid$(lck, j - 1, 1))
    h = (h \ 16) Xor (h * 16)
    Do While h > 255
      h = h - 256
    Loop
    Select Case h
      Case 0, 5, 36, 96, 124, 126
        LockToKey = LockToKey & "/%DCN" & Right$("00" & CStr(h), 3) & "%/"
      Case Else
        LockToKey = LockToKey & Chr$(h)
    End Select
  Next
End Function

PM Quote
Avatar
andriy88 (Ex-Member)
Pro


Messaggi: 118
Iscritto: 04/11/2005

Segnala al moderatore
Postato alle 17:09
Sabato, 19/11/2005
trasformato da solo.
Con un pu? di fatica ci sono riuscito....
he eh eh :D:D:asd::asd:

PM Quote