日期:2014-05-17 浏览次数:20742 次
public static String byte2Hex(byte[] b){
String hs="";
String stmp="";
for(int n=0; n<b.Length; n++){
stmp = (java.lang.Integer.toHexString(b[n]& 0XFF));
if(stmp.Length==1){
hs = hs + "0" + stmp;
}else{
hs = hs + stmp;
}
if(n<b.Length-1)hs=hs+":";
}
return hs.ToUpper();
}
public static string byte2Hex(byte[] b)
{
string hs = "";
string stmp = "";
for (int n = 0; n < b.Length; n++)
{
stmp = String.Format("{0:X}", b[n] & 0XFF);
if (stmp.Length == 1)
{
hs = hs + "0" + stmp;
&nb