以下为引用的内容:
function pinyin(byval chinese)
chinese = replace(chinese, "/", ""): chinese = replace(chinese, "", "")
chinese = replace(chinese, "*", ""): chinese = replace(chinese, "]", "")
chinese = replace(chinese, "[", ""): chinese = replace(chinese, "}", "")
chinese = replace(chinese, "{", ""): chinese = replace(chinese, "'", "")
chinese = getEnglish(chinese) '在这里使用getEnglish先将特殊词语转换
dim pinyinstr, istr, iIsCn, IsCn
dim pinyinconn, rs, i, x
'在这里打开拼音库
'你也可以将拼音库的并入你的程序数据库里.
on error resume next
set pinyinconn = server.createobject("Adodb.connection")
pinyinconn.open "Provider=Microsoft.Jet.OLEdb.4.0;Data Source=" & server.mappath("pinyin.Asp")
if err then pinyin = "": set pinyinconn = nothing: exit function
IsCn = true
for i = 1 to len(chinese)
iIsCn = IsCn ' 获取上次是不是中文的值
istr = Mid(chinese, i, 1)
x = Asc(istr)
if (x >= 65 and x = 97 and x = 48 and x