BYTE StringToByte(LPCTSTR strSrc,int nCount)
{
int nResult=0;
CString str(strSrc);
if (str.IsEmpty())
return nResult;
for(int i=0;i<nCount;i++)
{
int h=str.GetAt(i);
if(h>=48 && h <=57)
{
h=h-48;
}
else if(h>=65 && h <=70)
{
h=h-55;
}
else if(h>=97&&h <=122)
{
h=h-87;
}
nResult+=(int)pow(16,nCount-(i+1))* h;
}
return nResult;
}