ASP ReadAll Method
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 w3wiki. A computer science portal for Beginner" ) 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 w3wiki A computer science portal for Beginner.
Contact Us