会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
.net 学习
博客园
首页
新随笔
联系
订阅
管理
输入汉字取拼音
输入汉字取拼音
Public
Shared
Function GetPinYin()
Function
GetPinYin(
ByVal
t1
As
String
)
As
String
'
取得输入行字的拼音码
On
Error
Resume
Next
Dim
sOne, sChar, sRet
As
String
, i
As
Integer
For
i
=
1
To
Len
(t1)
sChar
=
Mid
(t1, i,
1
)
sOne
=
""
If
Asc
(sChar)
>
0
Then
If
UCase
(sChar)
<=
"
Z
"
And
UCase
(sChar)
>=
"
A
"
Then
sOne
=
UCase
(sChar)
Else
sOne
=
""
End
If
ElseIf
Asc
(sChar)
>=
Asc
(
"
啊
"
)
And
Asc
(sChar)
<
Asc
(
"
芭
"
)
Then
sOne
=
"
A
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
芭
"
)
And
Asc
(sChar)
<
Asc
(
"
擦
"
)
Then
sOne
=
"
B
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
擦
"
)
And
Asc
(sChar)
<
Asc
(
"
搭
"
)
Then
sOne
=
"
C
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
搭
"
)
And
Asc
(sChar)
<
Asc
(
"
蛾
"
)
Then
sOne
=
"
D
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
蛾
"
)
And
Asc
(sChar)
<
Asc
(
"
发
"
)
Then
sOne
=
"
E
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
发
"
)
And
Asc
(sChar)
<
Asc
(
"
噶
"
)
Then
sOne
=
"
F
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
噶
"
)
And
Asc
(sChar)
<
Asc
(
"
哈
"
)
Then
sOne
=
"
G
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
哈
"
)
And
Asc
(sChar)
<
Asc
(
"
击
"
)
Then
sOne
=
"
H
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
击
"
)
And
Asc
(sChar)
<
Asc
(
"
喀
"
)
Then
sOne
=
"
J
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
喀
"
)
And
Asc
(sChar)
<
Asc
(
"
垃
"
)
Then
sOne
=
"
K
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
垃
"
)
And
Asc
(sChar)
<
Asc
(
"
妈
"
)
Then
sOne
=
"
L
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
妈
"
)
And
Asc
(sChar)
<
Asc
(
"
拿
"
)
Then
sOne
=
"
M
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
拿
"
)
And
Asc
(sChar)
<
Asc
(
"
哦
"
)
Then
sOne
=
"
N
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
哦
"
)
And
Asc
(sChar)
<
Asc
(
"
啪
"
)
Then
sOne
=
"
O
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
啪
"
)
And
Asc
(sChar)
<
Asc
(
"
期
"
)
Then
sOne
=
"
P
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
期
"
)
And
Asc
(sChar)
<
Asc
(
"
然
"
)
Then
sOne
=
"
Q
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
然
"
)
And
Asc
(sChar)
<
Asc
(
"
撒
"
)
Then
sOne
=
"
R
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
撒
"
)
And
Asc
(sChar)
<
Asc
(
"
塌
"
)
Then
sOne
=
"
S
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
塌
"
)
And
Asc
(sChar)
<
Asc
(
"
挖
"
)
Then
sOne
=
"
T
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
挖
"
)
And
Asc
(sChar)
<
Asc
(
"
昔
"
)
Then
sOne
=
"
W
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
昔
"
)
And
Asc
(sChar)
<
Asc
(
"
压
"
)
Then
sOne
=
"
X
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
压
"
)
And
Asc
(sChar)
<
Asc
(
"
匝
"
)
Then
sOne
=
"
Y
"
ElseIf
Asc
(sChar)
>=
Asc
(
"
匝
"
)
Then
sOne
=
"
Z
"
End
If
sRet
=
sRet
&
sOne
Next
i
Return
sRet
End Function
输入汉字取得它的拼音
posted on
2007-06-19 14:18
小黑三
阅读(
686
) 评论(
1
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部