Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set fso = CreateObject("Scripting.FileSystemObject")
Function write_text(file,str)
Set f = fso.OpenTextFile(file, 2 ,True)
f.Write str
f.Close
End Function
Function read(file)
Set f = fso.OpenTextFile(file, 1 ,True)
read= f.ReadAll
s=read("1.txt") "1.txt原始檔名
s=Replace(s,".comn",".com")
s=Replace(s,".co",".com")
s=Replace(s,".comm",".com")
write_text "1.txt",s "1.txt生成結果檔名
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set fso = CreateObject("Scripting.FileSystemObject")
Function write_text(file,str)
Set f = fso.OpenTextFile(file, 2 ,True)
f.Write str
f.Close
End Function
Function read(file)
Set f = fso.OpenTextFile(file, 1 ,True)
read= f.ReadAll
f.Close
End Function
s=read("1.txt") "1.txt原始檔名
s=Replace(s,".comn",".com")
s=Replace(s,".co",".com")
s=Replace(s,".comm",".com")
write_text "1.txt",s "1.txt生成結果檔名