Le forum (ô combien francophone) des utilisateurs de Powerbuilder.
Pages: 1
1) télécharger le composant
http://sevillaonline.com/ActiveX/Base64.htm (lien direct : http://sevillaonline.com/ActiveX/Base64.zip)
2) enregistrer le composant
décompresser l'archive et copier Base64.dll
dans c:\windows\system32
regsvr32 c:\windows\system32\base64.dll
3) utiliser le composant
OLEObject lole_base64 Long ll_ok String ls_in, ls_out // connexion OLE lole_base64 = Create OLEObject ll_ok = lole_base64.ConnectToNewObject( 'Base64Lib.Base64' ) If ll_ok < 0 Then MessageBox('Erreur','ConnectToNewObject Base64Lib.Base64') Return End If // encodage ls_in = '123456789' ls_out = lole_base64.Encode( ls_in ) // => MTIzNDU2Nzg5 // décodage ls_in = 'MTIzNDU2Nzg5' ls_out = lole_base64.Decode( ls_in ) // =>123456789
4) toutes les propriétés et méthodes du composant
Properties:
* LastCount As Double. Returns the amount of time that the last operation took, in seconds.
Methods:
* Encode (strDatos As String) As String. Encodes data passed in strDatos and returns the result in a String var.
* EncodeArr (arrDatos() As Byte) As String. Encodes data passed in the array Datos and returns the result in a String var.
* EncodeArrArr (arrDatos() As Byte). This method will take data to encode from arrData() and will return the encoded data in the same array. It's the fastest one.
* EncodeFromFile (strPath As String) As String. Encodes the file specified in strPath and returns the result in a String var.
* Decode (strDatos As String) As String. Decodes data passed in strDatos and returns the result in a String var.
* DecodeArr (strDatos As String). Decodes data passed in strDatos and returns the result in an array.
* DecodeArrArr (arrDatos() As Byte). This method will take data to decode in arrDatos() and will return the decoded data in the same array. It's the fastest one.
* DecodeToFile (strDatos As String, strPath as String). Decodes data passed in strDatos and saves the result to the file given in strPath. If another file exists with the same name, it will try to overwrite it.
Hors ligne
Hors ligne
Merci !! ca marche nickel avec base64.dll
Je peux enfin envoyer mes pj ! :-)
Hors ligne
Pages: 1