to extcsdn(Studing VB now) fso是个什么东西啊,具体语法怎么写的?麻烦解说,谢谢
删除该文件,然后从新建一个同名的文件 Dim fs As Variant Set fs = CreateObject("scripting.filesystemobject") If fs.FileExists(filename) Then fs.DeleteFile (filename) '删除该文件 Set fso = fs.CreateTextFile(filename) '创建同名空文件 . . ; end if
Dim fso As Variant
strtmp="c:\1.txt" open strtmp for output as #1 print #,"" close #1 这个方法最简单了
fso是个什么东西啊,具体语法怎么写的?麻烦解说,谢谢
Dim fs As Variant
Set fs = CreateObject("scripting.filesystemobject")
If fs.FileExists(filename) Then
fs.DeleteFile (filename) '删除该文件
Set fso = fs.CreateTextFile(filename) '创建同名空文件
.
.
;
end if
open strtmp for output as #1
print #,""
close #1
这个方法最简单了
你所创建的文件个删除的文件是哪个?
filename是不是可以用文件路径代替?
strtmp="c:\1.txt"
open strtmp for output as #1
print #,""
debug.print lof(1) '这行是我添加的
close #1添加我写的行后显示文件长度为2
结贴
把mljboy(笑三少) 程序稍微改改就好了
谢谢大家
顺便说 wwqna(york) 的方法不行