参考filesystemobject. var fso = new ActiveXObject("Scripting.FileSystemObject") var a = fso.CreateTextFile("c:\\testfile.txt", true) a.WriteLine("This is a test.") a.Close
'写文件 Open "C:\dk.dat" For Output As #1 Print #1, text1.Text Close #1 '读文件 Open "C:\dk.dat" For Input As #1 text1.Text = StrConv(InputB(LOF(1), #1), vbUnicode) Close #1
var fso = new ActiveXObject("Scripting.FileSystemObject")
var a = fso.CreateTextFile("c:\\testfile.txt", true)
a.WriteLine("This is a test.")
a.Close
Open "C:\dk.dat" For Output As #1
Print #1, text1.Text
Close #1
'读文件
Open "C:\dk.dat" For Input As #1
text1.Text = StrConv(InputB(LOF(1), #1), vbUnicode)
Close #1
http://expert.csdn.net/Expert/topic/2413/2413600.xml?temp=.2489893