Skip to content
Related Articles

Related Articles

Improve Article
ASP ReadAll Method
  • Last Updated : 03 Mar, 2021

The ASP ReadAll Method is used to read all the contents from the Text file. It is a predefined method of the TextStream Object that returns a result string. 

Note: This method is not suitable for large files because it wastes memory resources. 

Syntax:

TextStreamObject.ReadAll 

Example Code: Below code illustrates the ASP ReadAll Method. 

ASP




<%
dim fs,f,t,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("d:\GFG.txt")
f.write("Hello GeeksForGeeks. A computer science portal for geeks")
f.close
  
set t=fs.OpenTextFile("d:\GFG.txt",1,false)
x=t.ReadAll
t.close
Response.Write("The entire content in the file is: " & x)
%>

Output:

The entire content in the files is : Hello GeeksForGeeks A computer science portal for geeks. 
My Personal Notes arrow_drop_up
Recommended Articles
Page :