Bonjours,
J'arrive maintenant à gérer la connexion en socket, à l'exception d'une chose : FlashKey.
On ma montrer ou se trouver le code as3. J'ai donc traduit 2 fonction sur 3. C'est la le problème.
Pour que cela sois plus claire je vais tout vous donner:
Mes fonction
Cliquez pour révéler
Cliquez pour masquer
Private Sub RandomKey()
Dim KEY_SIZE As UInteger = 21
Dim _loc1_ As String = ""
Dim _loc2_ As Long = KEY_SIZE - (1 + 3)
Dim _loc3_ As Long = 0
While (_loc3_ < _loc2_)
_loc1_ = _loc1_ + getRandomChar()
_loc3_ += 1
End While
' Return _loc1_ + checksum(_loc1_)
End Sub
Private Function getRandomChar()
Dim _loc1_ As Long = Math.Ceiling(Rnd() * 100)
If _loc1_ <= 40 Then
Return String.Format(Math.Floor(Rnd() * 26) + 65)
End If
If _loc1_ <= 80 Then
Return String.Format(Math.Floor(Rnd() * 26) + 97)
End If
Return String.Format(Math.Floor(Rnd() * 10) + 48)
End Function
Voila donc les 2 fonctions traduite.
Il reste une autre :
Fonction à traduire
Cliquez pour révéler
Cliquez pour masquer
private static function checksum(param1:String) : String
private static var hex_chars:Array = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];
{
var _loc2_:Number = 0;
var _loc3_:Number = 0;
while(_loc3_ < param1.length)
{
_loc2_ = _loc2_ + param1.charCodeAt(_loc3_) % 16;
_loc3_++;
}
return hex_chars[_loc2_ % 16];
}
Voila donc la fonction ou je bloque. Si une personne pourrais me donner un coup de pouce je dis pas non !
Voici ma fonction que j'ai essayer de traduire :
Ma fonction
Cliquez pour révéler
Cliquez pour masquer
Private Function checksum(param1 As String)
Dim _loc2_ As Long = 0
Dim _loc3_ As Long = 0
While _loc3_ < param1.Count
_loc2_ = _loc2_ + param1
_loc3_ += 1
End While
Return
End Function
Merci