bool MulTree::CheckName(const char * iName){
bool result=false;
if(strlen(iName)>62)return result;//长度不能超过62个字符
while(*iName)
{
if((*iName)&0x80){
//是汉字
result=true;
iName++;//知道是汉字的话跳过一个字节检测
}
else if((*iName>='a'&&*iName<='z'||*iName>='A'&&*iName<='Z')||((*iName)>='0'&&(*iName)<='9'))
{
result=true;
}
else{
result=false;
break;
}
iName++;
}
return result;
};
在visual c++中测试通过。