当前位置:首页 > 网络编程 > WEB编程 > ASP.net >  获取汉字拼音的第一个字母

 获取汉字拼音的第一个字母

点击次数:19 次 发布日期:2008-11-26 12:44:13 作者:源代码网
源代码网推荐      <script language="vbs" src="http://img.sxsky.net/it/spellcode.vbs"></script>
源代码网推荐  
源代码网推荐  
源代码网推荐  "获取客户简称的拼音缩写
源代码网推荐   function getpy()
源代码网推荐   dim str
源代码网推荐   dim i
源代码网推荐   str=document.all.txtContactName.value
源代码网推荐   dim ret
源代码网推荐   for i=1 to len(str)
源代码网推荐   ret=ret&getpychar(mid(str,i,1))
源代码网推荐   next
源代码网推荐   document.all.txtSpellCode.value=ret
源代码网推荐   end function
源代码网推荐   getpychar=char
源代码网推荐   end if
源代码网推荐  end function
源代码网推荐  spellCode.vbs
源代码网推荐  
源代码网推荐  
源代码网推荐  "获取汉字拼音第一字母
源代码网推荐  function getpychar(char)
源代码网推荐   dim tmp
源代码网推荐   tmp=65536+asc(char)
源代码网推荐   if(tmp>=45217 and tmp<=45252) then
源代码网推荐   getpychar= "A"
源代码网推荐   elseif(tmp>=45253 and tmp<=45760) then
源代码网推荐   getpychar= "B"
源代码网推荐   elseif(tmp>=45761 and tmp<=46317) then
源代码网推荐   getpychar= "C"
源代码网推荐   elseif(tmp>=46318 and tmp<=46825) then
源代码网推荐   getpychar= "D"
源代码网推荐   elseif(tmp>=46826 and tmp<=47009) then
源代码网推荐   getpychar= "E"
源代码网推荐   elseif(tmp>=47010 and tmp<=47296) then
源代码网推荐   getpychar= "F"
源代码网推荐   elseif(tmp>=47297 and tmp<=47613) then
源代码网推荐   getpychar= "G"
源代码网推荐   elseif(tmp>=47614 and tmp<=48118) then
源代码网推荐   getpychar= "H"
源代码网推荐   elseif(tmp>=48119 and tmp<=49061) then
源代码网推荐   getpychar= "J"
源代码网推荐   elseif(tmp>=49062 and tmp<=49323) then
源代码网推荐   getpychar= "K"
源代码网推荐   elseif(tmp>=49324 and tmp<=49895) then
源代码网推荐   getpychar= "L"
源代码网推荐   elseif(tmp>=49896 and tmp<=50370) then
源代码网推荐   getpychar= "M"
源代码网推荐   elseif(tmp>=50371 and tmp<=50613) then
源代码网推荐   getpychar= "N"
源代码网推荐   elseif(tmp>=50614 and tmp<=50621) then
源代码网推荐   getpychar= "O"
源代码网推荐   elseif(tmp>=50622 and tmp<=50905) then
源代码网推荐   getpychar= "P"
源代码网推荐   elseif(tmp>=50906 and tmp<=51386) then
源代码网推荐   getpychar= "Q"
源代码网推荐   elseif(tmp>=51387 and tmp<=51445) then
源代码网推荐   getpychar= "R"
源代码网推荐   elseif(tmp>=51446 and tmp<=52217) then
源代码网推荐   getpychar= "S"
源代码网推荐   elseif(tmp>=52218 and tmp<=52697) then
源代码网推荐   getpychar= "T"
源代码网推荐   elseif(tmp>=52698 and tmp<=52979) then
源代码网推荐   getpychar= "W"
源代码网推荐   elseif(tmp>=52980 and tmp<=53688) then
源代码网推荐   getpychar= "X"
源代码网推荐   elseif(tmp>=53689 and tmp<=54480) then
源代码网推荐   getpychar= "Y"
源代码网推荐   elseif(tmp>=54481 and tmp<=62289) then
源代码网推荐   getpychar= "Z"
源代码网推荐   else "如果不是中文,则不处理
源代码网推荐   getpychar=char
源代码网推荐   end if
源代码网推荐  end function
源代码网推荐  
源代码网推荐  
源代码网推荐  
源代码网推荐    做人要厚道,请注明转自酷网动力(www.ASPCOOL.COM)。
源代码网推荐


源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华