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

What are asp controls?

509


We have recently bought Hart 475 communicator , when we try to use it on transmitter it shows error : Voltage detected on FF connectors and later show No device found , can any one give me and idea about how to solve it.

2174


What is the difference between cshtml and aspx?

537


What is an asp program?

507


What are the asp components?

528






What are the stored procedures?

498


How add insert options in datagrid control in footer row.

1933


Can I use the win32 api from a .net framework program?

499


how to implemet online examination in asp.net

1580


we are doing Design of Placement Website as our academic project. Home page is in c#.net format and register page is in asp.net format. We met a problem in this.register page is not linked in home page. how i complete my project with out any change..?

1562


What is asp format?

498


Is classic asp dead?

552


How do in-process and cross-process communication work in the common language runtime?

486


Explain the difference between cookies collection and form/querystring collection?

529


How can you disable the browser to view the code?

493