@
blackeeper 从网上看到这个批处理文件,不太成功,问题出在哪里了呢,技术不太行,只能照葫芦画瓢
Private Sub Command1_Click()
Dim FileNumber1, FileNumber2, Str As String
FileNumber1 = FreeFile '得到一个未使用的文件号。
Open "D:\gif-00000\123.txt" For Input As #FileNumber1 '打开要读取的文件
FileNumber2 = FreFile
Open "D:\gif-00000\abc.txt" For Output As #FileNumber2 '打开要写入的文件
While Not EOF(1) ‘直到最后一行
Line Input #FileNumber1, Str ’按行读取文件
Str = Replace(Str, "lkjhgiu111", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu112", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu113", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu114", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu115", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu116", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu117", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu118", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu119", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu120", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu121", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu122", "大") ‘替换第一个字符
Str = Replace(Str, "lkjhgiu123", "大") ‘替换第一个字符
Print #FileNumber2, Str '写入替换后的内容
Wend
Close #FileNumber1 '关闭文件
Close #FileNumber2 '关闭文件
End Sub