在一篇a.txt的文件中,编程读出其内容,将所有字符替换,怎么办?

vb中
2024-12-15 09:50:30
推荐回答(1个)
回答1:

Private Declare Function icePub_readFileToText Lib "icePubDll.dll" (ByVal strFilename As String,ByVal strText As String,ByVal maxLen As Integer) As Integer
Private Declare Function icePub_writeTextToFile Lib "icePubDll.dll" (ByVal strText As String ,ByVal strFilename As String ,ByVal traceFlag As Integer) As Integer

Dim a2 As Integer
Dim strText As String

strText=Space(1024+1)

a2 = icePub_readFileToText("D:\test\a.txt",strText,1024)

MsgBox strText

'replace...

a2 = icePub_writeTextToFile(strText,"D:\test\b.txt",1)

'下载
http://dl.icese.net/dev.php?f=icePubDll.rar