已经解决了哦,是这样的
<%
response.write(GetHEX("aa"))
function GetHEX(str)
if str = "" then
GetHEX=0
end if
iLength = Len(str)
itemp =0
for i=1 to iLength
T = GetNO(left(right(str,i),1))
if T=-1 then
GetHEX=0
Exit function
end if
T = (16^(i-1))*T
itemp=itemp+T
next
GetHEX=hex(itemp)
end function
'取得对应值
function GetNO(str)
iLength = len(str)
if ilength=0 then
GetNO=-1
end if
if IsNumeric(str) then
GetNO=str
Exit function
end if
select case str
case "a","A"
GetNO=10
case "b","B"
GetNO=11
case "c","C"
GetNO=12
case "d","D"
GetNO=13
case "e","E"
GetNO=14
case "f","F"
GetNO=15
case default
GetNO=-1
end select
end function
%>