首 页 | 精品电影 | 音乐天堂 | 在线游戏 | Flash MTV | 三湘书屋 | 幽默笑话 | 三湘图库 | 美女写真 | IT知识库 | QQ贴图 | 加入书签

网页制作网络编程图形图象操作系统冲浪宝典软件教学网络安全认证考试通信技术电子商务业内动态书籍教程原码

最近更新 文章分类 多媒体类 精品软件

本站搜索:
您的位置:三湘时空 -> IT知识库 -> 文章分类 -> ASP.NET技巧 -> 获取汉字拼音的第一个字母
获取汉字拼音的第一个字母


文章类别:ASP.NET技巧 来源: 作者: 发表日期:2006-5-9 字体:[ ]

小游戏 | 在线影院 | 幽默笑话 | 源码下载 | Flash MTV | 音乐试听 | 书屋 | 美女写真

<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

上一篇:调用PanelDesigner类时出现找不到命名空间的解决 下一篇:ASP.NET服务器控件编程之热身运动
本栏目热门文章
·如何实现无刷新的DropdownList联动效果 2005-10-4
·使用HttpWebRequest向网站模拟上传数据 2005-10-4
·当DataSet中包含主/子表时,Update更新步骤 2005-10-6
·ASP.NET2.0实现无刷新客户端回调 2005-11-13
·ASP.NET中文件上传下载方法集合 2006-5-28
·分享个极好的无刷新二级联动下拉列表,同样适用与firefox 2005-10-19
·在Web DataGrid中当鼠标移到某行与离开时行的颜色发生改变( 2005-10-4
·ASP.NET中实现Flash与.NET的紧密集成 2005-11-21
·关于Asp.net页面Page_Load被执行两次的问题 2005-10-4
·ASP.NET极限:页面导航 (翻译) 2005-10-8
新近更新文章
·在VS2003中直接用DREAMWEAVER8打开ASPX文件 2006-6-22
·asp.net2.0中异步调用WebService(异步页) 2006-6-22
·ASP.NET2.0数据库入门之常见错误 2006-6-22
·ASP.NET 2.0中XSLT的使用 2006-6-22
·.Net2.0 使用ConfigurationManager读写配置 2006-6-22
·.net 做的IP 访问限制 2006-6-22
·ASP.Net2.0 GridView 多列排序,显示排序图标,分页 2006-6-22
·数据岛出到Excel最为简易的方法 2006-6-20
·权限树中Checkbox的操作[Asp.Net2.0] 2006-6-20
·使用Data Access Application Block 得到 2006-6-20
首 页 | 软件发布 | 广告联系 | 下载帮助 | 意见反馈 | 网站地图
  CopyRight? 2002-2004 WWW.SXSKY.NET? All Rights Reserved
三湘时空 站长QQ:82675303 Email: