首页
关于我们
服务项目
作品展示
服务支持
联系我们
友情链接
网站地图
 您当前位置:网络学院 -> 编程开发系-> 编程开发-> Asp教程
asp中获取汉字拼音的第一个字母
作者:admin 来源:网络
日期: 2007-2-27
站内搜索
文章页数:[1] 
<script language="vbs" src="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

文章页数:[1] 
放大字体显示 缩小字体显示 打印文章 推荐给朋友
热门文章
·ASP生成静态Html文件技术杂谈
·ASP中实现小偷程序的原理和简单示例
·ASP六大对象介绍
·ASP开发中存储过程应用全接触
·如何把ASP编写成DLL
·用ASP+CSS实现随机背景
·看人家用使用InstallShield制作ASP安装程序
·ASP正则表达式详解
·使用ADO.net将数据导出到Excel并提供下载
·解析ASP的Application和Session对象
最新文章
·在ASP中轻松实现记录集分页显示
·在ASP中访问和更新Cookies集合
·ASP.NET中实现Flash与.NET的紧密集成
·解析ASP的Application和Session对象
·[asp]让你知道codepage的重要,关于多语言编码
·ASP中实现小偷程序的原理和简单示例
·ASP程序中使用断开的数据记录集
·利用ASP发送和接收XML数据的处理方法
·ASP开发中存储过程应用全接触
·如何让你的ASP运行于非Windows平台
相关主题
  • asp实现语音上传
  • 使ASP程序跨浏览器
  • 版权申明:除部分特别声明不要转载,或者授权本站独家播发的文章外,大家可以自由转载本站的原创文章,但原作者和来自本站的链接必须保留(非本站原创的,按照原来自一节,自行链接)。文章版权归本站和作者共有。
    转载要求:转载之图片、文件,链接请不要盗链到本站,且不准打上各自站点的水印,亦不能抹去本站水印。
    特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。
    发表评论  打印  刷新  推荐给朋友  返回顶部  关闭

    网上大名: