有懂VB的C#大虾没,帮忙把这个生成拼音码的方法转成C#下吧,小女万分感谢.
long length_string,step_string,asc_char,i
string pym_string,pym,char_string
// 取得字符串长度
length_string = len(hz_cluster)
// 设定初始值
i = 1
pym_string = ' '
do until i > length_string
char_string = mid(hz_cluster,i,1)
asc_char = asc(char_string)
// 设定默认步长
step_string = 1
if asc_char > 64 and asc_char < 91 then // 大写字母
pym = char_string
elseif asc_char > 96 and asc_char < 123 then // 小写字母
pym = char_string
elseif asc_char > 47 and asc_char < 58 then // 数字
pym = char_string
elseif asc_char > 127 then // 汉字,步长为2
char_string = mid(hz_cluster,i,2)
select pym into :pym from sys_hzk where hz=:char_string;
If Sqlca.sqlcode <> 0 Then pym = '* '
pym = mid(pym,1,1)
step_string = 2
else // 其它字符
pym = ' '
end if
i = i + step_string
pym_string = pym_string + pym
loop
// 以小写方式返回
return left(upper(pym_string),12)
string pym_string,pym,char_string
// 取得字符串长度
length_string = len(hz_cluster)
// 设定初始值
i = 1
pym_string = ' '
do until i > length_string
char_string = mid(hz_cluster,i,1)
asc_char = asc(char_string)
// 设定默认步长
step_string = 1
if asc_char > 64 and asc_char < 91 then // 大写字母
pym = char_string
elseif asc_char > 96 and asc_char < 123 then // 小写字母
pym = char_string
elseif asc_char > 47 and asc_char < 58 then // 数字
pym = char_string
elseif asc_char > 127 then // 汉字,步长为2
char_string = mid(hz_cluster,i,2)
select pym into :pym from sys_hzk where hz=:char_string;
If Sqlca.sqlcode <> 0 Then pym = '* '
pym = mid(pym,1,1)
step_string = 2
else // 其它字符
pym = ' '
end if
i = i + step_string
pym_string = pym_string + pym
loop
// 以小写方式返回
return left(upper(pym_string),12)
...全文
相关推荐
VB6.0调用C# Dll解决方法
VB6.0调用C# Dll解决方法 用C#实现dll 用cmd命令生成tlb文件 VB引用tlb文件 进行引用。
vb调用C#写的dll
在做系统升级维护的项目中,用到了老系统(VB实现)要调用一部分新功能(C#实现)的情况,于是进行了简单的调查。发现如下资料网上发现的资料。---------------------------------------------------------------------------------------------------------------里面有两个方法
C# 编写DLL 让VB调用
VB调用C#编写的DLL 使用VS C#编写DLL函数。封装好,实现DLL注册功能。达到VB调用。
VB和C#互相调用
1.VB调用C#编写的dll 2.C#调用VB写的Dll
VB.Net to C# Converter将VB代码转换成C#代码
本资源为【VB.Net to C# Converter】软件,它可以将VB代码转换成C#代码,效果很好


