explain uses of Textstream object in ASP

Answer Posted / jatin arora

The TextStream Object

The TextStream object is used to access the contents of text
files.

The following code creates a text file (c:\test.txt) and
then writes some text to the file (the variable f is an
instance of the TextStream object):


<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt",true)
f.WriteLine("Hello World!")
f.Close
set f=nothing
set fs=nothing
%>

To create an instance of the TextStream object you can use
the CreateTextFile or OpenTextFile methods of the
FileSystemObject object, or you can use the OpenAsTextStream
method of the File object.

The TextStream object's properties and methods are described
below:

Properties

Property Description

AtEndOfLine Returns true if the file pointer is positioned
immediately before the end-of-line marker in a TextStream
file, and false if not

AtEndOfStream Returns true if the file pointer is at the
end of a TextStream file, and false if not
Column Returns the column number of the current character
position in an input stream

Line Returns the current line number in a TextStream file

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to insert the records in a database table by using asp?

675


When was asp released?

685


Explain the event handlers of session object?

746


Explain the different types of session state management options available with asp.net?

652


What is active server object model?

707


Name the event handlers of application object?

709


What is the difference between html and asp?

721


Define unmanaged code?

736


How do I open an asp file on a mac?

795


Define a dictionary object?

763


what is page

1600


Define collection?

708


Define request object?

698


What is pdf aspx?

688


What is Response object? How is it related to ASP's Response object?

773