网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP.NET技巧
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.如何实现无刷新的DropdownList联.
.一个无刷新效果定时自动更新页面.
.认识asp.net会话状态.
..NET编程规范.
.关于ASP.NET2.0编写扩展存储过程.
.在IIS6.0下ASP .NET 的版本冲突问.
.ASP.NET查询ACCESS数据库的内容并.
.彻底放弃IIS让Apache也支持ASP.N.
.ASP.NET 数据绑定常用代码.
.ASP.net生成文字图片.
.通过避免下列10个常见ASP.NET缺陷.
..NET框架2.0里的aspnet_compiler.
.如何在上传的图片上写字.
.深入聊聊Array的sort方法的使用技.
.在Visual Studio 2005和ASP.NET .
.何时.NET中AppDomain会回收? .
.ASP.NET中利用cookies保持客户端.
.asp.net 2.0下嵌套masterpage页的.
.投票结果的图片进度条显示.
.通过反射填充泛型集合List的静态.

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

发表日期:2006-5-9


<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

上一篇:调用PanelDesigner类时出现找不到命名空间的解决 人气:6382
下一篇:ASP.NET Atlas对JavaScript的扩展 人气:6108
浏览全部asp.net的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐