string类型转换为byte[]:
string str = "Test";
byte[] bytTemp = (str);
byte[]转换为string
string strTemp = (bytTemp);
但是得到的结果为54-65-73-74,这里需要进行转换
转换代码:
string[] strSplit = ('-');
byte[] bytTemp2 = new byte[];
for(int i = 0; i < ; i++)
{
bytTemp2[i] = (strSplit[i],);
}
string strResult = (bytTemp2);
可以看到strResult = “Test”