關閉

Close 是用於關閉開啟中檔案的一個執行個體。

語法

關閉

結果

未傳回資料。

範例

該指令碼將開啟本機 C 磁碟機上的檔案(test.txt),然後向其中寫入兩行:

Function Main

Dim textfile As Object

Set textfile = File.Connect("127.0.0.1")

If textfile.Open("c:\test.txt", GENERIC_WRITE, CREATE_ALWAYS) Then

textfile.WriteLine("您好,這是測試檔案")

textfile.WriteLine("這是使用 GFI LanGuard 指令碼建立的")

textfile.Close

End If

End Function