1 2 3 4 5 6 7 8 9 10 11 12 13
| Public Function DecodeBase64(Text As String) As String
Dim Utl As New CAPICOM.Utilities
DecodeBase64 = StrConv(Utl.Base64Decode(Text), vbUnicode)
End Function
Public Function EncodeBase64(Text As String) As String
Dim Utl As New CAPICOM.Utilities
Dim iPnt As Integer
EncodeBase64 = Utl.Base64Encode(StrConv(Text, vbFromUnicode))
'je ne sais pas pourqoui, la fonction retourne une chaine terminée par CR+LF
If Right(EncodeBase64, 2) = vbCrLf Then
EncodeBase64 = Left(EncodeBase64, Len(EncodeBase64) - 2)
End If
End Function |
Partager