Bonjour,
J'ai un problème lorsque j'utilise BerConverter.Decode
La fonction lève l'exception suivante:Je ne comprend pas ou est le problème vu que j'utilise la même chaine de format à l'encodage.La chaîne "format" contient un caractère non valide.
Voici mon code de test:
Merci de m'aider.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 void MonTest() { try { string strTest="Données Encodées"; string strDecoded=""; byte[] byteData= Encoding.ASCII.GetBytes(strTest); byte[] encodedData= BerConverter.Encode("{o}", byteData); object[] objDataDecoded=BerConverter.Decode("{o}",encodedData); if ( objDataDecoded.Length !=0) { strDecoded=(string)objDataDecoded[0]; } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
Partager