把一个文件
name
成绩
替换为
张三
95用另一个文件做为模板存为张三.txt

解决方案 »

  1.   

    Const ForReading = 1
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objuser = objFSO.OpenTextFile ("tx2.txt", ForReading)
    Do Until objuser.AtEndOfStream
    str1 = objuser.ReadLine
        use1r=split(str1,"=")
    Set objFSO2 = CreateObject("Scripting.FileSystemObject")
    Set objmoban = objFSO2.OpenTextFile ("moban.txt", ForReading)
    strContents = objmoban.ReadAll
    strNewText = Replace(strContents, [user1], use1r(0))
    strNewText = Replace(strContents, [pw], use1r(1))
    msgbox use1r(0)
    msgbox use1r(1)
    objmoban.Close
    Set objFSO3 = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO3.CreateTextFile(use1r(0)+".vbs")
    strResponses = objFile.Writeline(StrNewText)
    objFile.Close为什么不能替换成功啊??Loop
    objuser.Close