VB编写“繁体.txt文档转化成简体.txt 的程序”。用 .dll

来源:百度知道 编辑:UC知道 时间:2024/09/28 13:11:11
VB编写“繁体.txt文档转化成简体.txt 的程序”。用 .dll。
我不懂,大虾们帮忙,是我一朋友的问题。
先50分,好后再加20--30分。

下面的是对文本框内的内容进行转换
换成文本文件,我想应该不难吧?

Option Explicit
Private Declare Function LCMapString Lib "kernel32" Alias _
"LCMapStringA" (ByVal Locale As Long, ByVal dwMapFlags As _
Long, ByVal lpSrcStr As String, ByVal cchSrc As Long, _
ByVal lpDestStr As String, ByVal cchDest As Long) As Long
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" _
(ByVal lpString As String) As Long

Dim STf As String '繁体字符串
Dim STj As String '简体字符串
Dim STlen As Long ' 待转换字串长度
Private Sub Command1_Click() 'Gb码简体转繁体
STj = Text1.Text
STlen = lstrlen(STj)
STf = Space(STlen)
LCMapString &H804, &H4000000, STj, STlen, STf, STlen
Debug.Print STf
Text2.Text = STf
End Sub

Private Sub Command2_Click() 'Gb码繁体转简体
STf = Text2.Text
STlen = lstrlen(STf)
STj = Space(STlen)
LCMapString &H804, &H2000000, STf, STlen, STj, STl