Could you tell me how to convert the above is to come over?
I am such operation, but the result is wrong:
Byte [] bytes=the Convert. FromBase64String (" ZmLVuCs4H/zX6E63 + i2Ung==");
String=base64 Encoding. UTF8. Get string (bytes);
Response. Write (GetHexFromChs (output));
//string converted to hexadecimal
Public static string GetHexFromChs (string s)
{
If ((s.L ength % 2)!=0)
{
S +="";//space
//throw new ArgumentException (" s is not valid Chinese string!" );
}
System. Text. Encoding CHS=System. Text.. Encoding UTF8;
Byte [] bytes=CHS. GetBytes (s);
String STR="";
for (int i=0; I & lt; Bytes. The Length; I++)
{
STR +=the string. Format ("} {0: X ", bytes [I]);
}
return str;
}
CodePudding user response:
Var hex="";The foreach (var b in bytes)
{
Hex +=b.T oString (" x2 ");
}
CodePudding user response:
Show one reply on the BBS, how do I point open to see other people's reply??CodePudding user response:
This time CSDN is tic, ah, it seems to be cold,