string StrToHex(string str)
{
string strTemp = "";
if(str="")
return "";
byte[] bTemp = System.Text.Encoding.Default.GetBytes(str);
for(int i = 0;i
1<btemp.length;i++) '0',="" '1',="" '2',="" '3',="" '4',="" '5',="" '6',="" '7',="" '8',="" '9',="" 'a',="" 'b',="" 'c',="" 'd',="" 'e',="" 'f'};="" (int="" *="" +='bTemp[i].ToString("X");' 2]="hexDigits[b" 2];="" <="" b="bytes[i];" bytes)="" bytes.length;="" char[]="" char[bytes.length="" chars="new" chars[i="" for="" hexdigits="{" i="" i++)="" int="" return="" string="" strtemp="" strtemp;="" tohexstring(byte[]="" {="" }="" 下面摘自csdn,byte[]="" 很快,没有测试="" 转="">> 4];
2chars[i * 2 + 1] = hexDigits[b & 0xF];
3}
4return new string(chars);
5}</btemp.length;i++)>