Open In App

ASP TextStream.Close Method

Last Updated : 03 Mar, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

The ASP TextStream.Close Method is a predefined method of the TextStream Object which is used to close an opened text file. 

Syntax:

TextStreamObject.Close 

Example: Below code illustrates the ASP close Method. 

ASP




<%
dim gfg,f
set gfg=Server.CreateObject("Scripting.FileSystemObject")
// creating the file
set f=gfg.CreateTextFile("e:\Geeks.txt",true)
// Add content 
f.WriteLine("Hello Geeks")
//close the file
f.Close
Response.write("File is closed")
set f=nothing
set gfg=nothing
%>


Output:

File is closed

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads