filename="C:\Users\Administrator\Desktop\soft\x.txt"
filename2="C:\Users\Administrator\Desktop\soft\x.txt"

Dim txt 
Dim txt2
txt=ReadFromTextFile( filename )
txt=Replace( txt,"xx软件","yy软件" )


WriteToTextFile filename2,txt

Set a = CreateObject("Scripting.FileSystemObject")
a.CopyFile "C:\Users\Administrator\Desktop\soft\web.xml","C:\",true

msgbox "ok"


 Function ReadFromTextFile(FileUrl)
 dim str
 set stm=CreateObject("adodb.stream")
 stm.Type=2'以本模式读取
 stm.mode=3 
 stm.charset="UTF-8"
 stm.open
 stm.loadfromfile  FileUrl 
 str=stm.readtext
 stm.Close
 set stm=nothing
 ReadFromTextFile=str
End Function

Sub WriteToTextFile(FileUrl,byval Str)
 set stm=CreateObject("adodb.stream")
 stm.Type=2'以本模式读取
 stm.mode=3
 stm.charset="UTF-8"
 stm.open
 stm.WriteText str
 stm.SaveToFile  FileUrl ,2 
 stm.flush
 stm.Close
 set stm=nothing
End Sub

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2021-12-02
  • 2021-12-01
猜你喜欢
  • 2021-09-05
  • 2021-10-22
  • 2021-06-16
  • 2022-12-23
  • 2021-12-15
  • 2021-11-06
相关资源
相似解决方案