怎么找不到FileSystemObject
编号:QA003013
建立日期: 2000年6月5日 最后修改日期:2000年6月5日
所属类别:
张洛惠:
操作系统: Windows95
编程工具: VB6.0
问题: 我想用VB6.0中的FileSystemObject这个控件,但怎么也找不到它,可以找到FileSystem这个控件,但FileSystem控件与FileSystemObject控件好象是不一样的,我想要的是FileSystemObject控件,麻烦您给帮忙解决一下好吗,拜托了,谢谢。
回答:
FileSystemObject并不是一个控件,它只是一个类。你可以选择“工程|引用”,在其中可以选择Microsoft Scripting Runtime。然后你就可以使用了,如
'Declare variables.
Dim fso As New FileSystemObject
Dim ts As TextStream
'Open file.
Set ts = fso.OpenTextFile(Environ("windir") & "\system.ini")
'Loop while not at the end of the file.
Do While Not ts.AtEndOfStream
Debug.Print ts.ReadLine
Loop
'Close the file.
ts.Close
此问题由gxc回答。
| |
|
|
| |
|
|