ASP Read Method
The ASP Read Method is used for reading a specified number of characters in a TextStream file. It is a predefined method of the TextStream Object that returns a result as a string.
Syntax:
TextStreamObject.Read(numchar)
Parameter Value:
- numchar: Required attribute. It contains a numeric value that represents the number of characters that you want to read from the file.
Example: Below code illustrates the ASP Read Method.
ASP
<% dim gfg,f,t,x set gfg=Server.CreateObject( "Scripting.FileSystemObject" ) set f=gfg.CreateTextFile( "e:\GFG.txt" ) f.write( "Hello w3wiki" ) f.close set t=gfg.OpenTextFile( "e:\GFG.txt" ,1,false) x=t.Read(10) t.close Response.Write( "The First Ten characters are: " & x) %> |
Output:
Hello Beginner
Contact Us