Learnthat.com Free Certification and Computer Online Courses
ThatNetwork.com Internet Media Network Givethat.com free gift ideas Definethat.com - Free technical definitions, define Free Romance Tips, Romantic Tips, Date Ideas Free POD publisher comparison print on demand
Learnthat.com Free A+ Certification, Computer Classes, Certification Courses, Business, Lifestyle, ApplicationsFree business tutorials and definitionsFree certification tutorials and definitionsFree computer and technical tutorials and technical definitionsFree Finance Tutorials and DefinitionsFree House Repair TutorialsFree Lifestyle and Fun Tutorials
  All Online CoursesNew Courses QuickTipsWord DefinitionsSubmit a TutorialLinks
÷ Resources
Home
free tech tutorials
Free Tutorials
free tech tutorials
Certifications
free tech tutorials
Definitions
free tech tutorials
Resources/Links
free tech tutorials
Forums
free tech tutorials
Distance Education
free tech tutorials
Highest Rated Tutorials
÷ Popular Tutorials
÷ New Tutorials

Active Server Pages (ASP)

 

The TextStream Object

The TextStream object lets you create and work with a text file.

TextStream Object: Methods

Close

Closes the text file.

Read

Returns a specified number of characters from a text file.

ReadAll

Returns an entire text file.

ReadLine

Returns a line from a text file.

Skip

Skips a specified number of characters when reading a text file.

SkipLine

Skips a line when reading a text file.

Write

Writes text to a text file.

WriteLine

Writes a line of text to a text file.

WriteBlankLine

Writes the specified number of blank lines to a text file.


TextStream Object: Properties

AtEndOfLine

Is "true" if the location is just before the end of a line in a text file.

AtEndOfStream

Is "true" if the location is at the end of a text file.

Column

Returns the column number of the current character.

Line

Returns the line number of the current position.

The following code creates a text file, writes a line that contains title text, creates two blank lines, writes heading text using tabs (the ASCII code chr(9)) between the headings, and then creates another blank line before closing the file:

<%

Dim varFileSystem, varTextStream

Set varFileSystem=Server.CreateObject("Scripting.FileSystemObject")

Set varTextStream=varFileSystem.CreateTextFile("c:\plist.txt")

varTextStream.WriteLine "Company Call List"

varTextStream.WriteBlankLines(2)

varTextStream.Write "Name" & chr(9)

varTextStream.Write "Employee ID" & chr(9)

varTextStream.Write "Phone Number"

varTextStream.WriteBlankLines(1)

varTextStream.Close

%>

You must close the file in order to allow users to access it.

Once you've created a text file, you can use the TextStream object to open the file and display its contents in an ASP page:

<%

Dim varFileSystem, varTextStream

Set varFileSystem=Server.CreateObject("Scripting.FileSystemObject")

Set varTextStream=varFileSystem.OpenTextFile("c:\plist.txt")

Response.Write(varTextStream.ReadAll)

%>

 

 

by Summer Doucet

Find more free Internet tutorials from Learnthat.com.

More Information:

Help us by rating this tutorial: [---] [--] [+] [++] [+++]
[---] lowest; [+++] highest

 

 

 


Learn: Free Tutorials - Links to Free Tutorials
Understand: Free Technical Definitions - ExplainThat Whitepapers
Use: Certification Section - Discussion Forum

Visit Our Network Sites:

DefineThat.com Technical Defintions Romancetips.com
Free Gift Ideas - GiveThat Planthat.com Free Unique Business Ideas
PublishOnDemand.net - Learn about Print on Demand (POD) - Self Publishing Seekthat.com - Technical Search Engine
ThatNetwork.com  

About Us : Contact Us : Advertise : Privacy Information

© 1998-2004 Learnthat.com