for li_loops=1 to 6
ls_temp=mid(ls_mac,li_pos1,li_pos2 -li_pos1)
if len(trim(ls_temp))<>2 or isnull(trim(ls_temp)) or trim(ls_temp)='' then lb_macflag=false
if li_loops<>6 then
li_pos1=li_pos2+1
li_pos2=pos(ls_mac,':',li_pos1)
if li_pos2<=0 then
if li_loops=5 then
li_pos2=len(ls_mac)+1
else
lb_macflag=false
end if
else
if li_loops=5 then
lb_macflag=false
end if
end if
end if
next
if lb_macflag=true then
ls_macdata=''
for li_loops=1 to len(data)
ls_temp=mid(data,li_loops,1)
if not isnumber(ls_temp) then
ls_temp=upper(ls_temp)
if (Asc ( ls_temp ) >= asc('A') and Asc ( ls_temp ) <= asc('F')) or (Asc ( ls_temp ) >= asc('0') and Asc ( ls_temp ) <= asc('9')) or asc(ls_temp)=asc(':') then
lb_macflag = true
else
lb_macflag = false
exit
end if
end if
ls_macdata=ls_macdata+ls_temp
next
end if
if lb_macflag=false then
Messagebox("提示","您第"+string(row)+"行输入了错误格式的MAC值!")
return 1
end if