Function WriteToFile Const ForReading = 1, ForWriting = 2 Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True) f.Write "嗨,你好!" Set f = fso.OpenTextFile("c:\testfile.txt", ForReading) WriteToFile = f.ReadLineEnd Function