explain uses of Textstream object in ASP



explain uses of Textstream object in ASP..

Answer / 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

More ASP Interview Questions

How could u display all of the cookies/cookie values for a user through a Web page in ASP?

1 Answers   Google,


different web application and windows application

1 Answers  


1)Declare array with five elements a[]={8,4,6,2,1,10} Print minimum and maximum no from array.

1 Answers   Infosys, Syntel,


What is http header?

1 Answers  


How many Max Cookies can we create in Server? A. 10 B. 20 C. 30 D. 40

4 Answers   TCS,


What is application object in asp?

1 Answers  


Using VBScript, which of the following Scripting Object(s) is NOT available from scrrun.dll? A. TextStream B. Dictionary Object C. Err Object D. FileSystemObject E. All are available from scrrun.dll.

1 Answers  


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

1 Answers   MCN Solutions,


How to convert a string into an integer in .net?

1 Answers  


What is the difference between jsp and asp?

1 Answers  


Define an application domain?

1 Answers  


What is an asp model?

1 Answers  


Categories