Working with the TextStream Object Washington

The TextStream object is the heart of most of the file manipulation in ASP 3.0. Check out this article to see the TextStream object in action.

Local Companies

Free Data Recovery Software
001-991-1111 x111
lane
State, WA
Benaroya Research Institute at Virginia Mason
(206) 341-1313
1201 9th Ave.
Seattle, WA
Dendreon Corporation
(206) 256-4545
3005 1st Ave.
Seattle, WA
Advanced Computer Solutions Ltd.
(206) 624-7854
500 Union St.,
Seattle, WA
Envision Telephony, Inc.
(206) 621-9384
520 Pike St.,
Seattle, WA
ClearStar.net
360-892-0687
915 Broadway
Vancouver, WA
Advanced Clinical Software
206-728-0313
2212 4th Ave
Seattle, WA
BioLife Solutions, Inc.
(425) 402-1400
3303 Monte Villa Pkwy, Ste. 310
Seattle, WA
IMAGINiT Technologies, Inc.
(206) 682-8032
2101 4th Ave.,
Seattle, WA
Coolearth Technologies, Inc.
(206) 770-9061
226 S Orcas St.
Seattle, WA

provided by: 
Originally published at Internet.com


This article is brought to you by Premier Press
publisher of John Gosney's ASP Programming for the Absolute Beginner.

Working with the TextStream Object

The TextStream object is the heart of most of the file manipulation in ASP 3.0. There are three specific methods within the TextStream object: CreateTextFile, OpenTextFile, and OpenAsTextStream. The TextStream object has its own set of properties and methods. First, the properties: * AtEndOfLine. Returns a value of True if the file pointer (the location of the response as the file is read) is at the end of a line in the file * AtEndOfStream. Returns a value of True if the file pointer is at the end of the file * Column. Depending on the current character being read within the file, returns the column number of this character, starting from 1 * Line. Depending on the current line number being read within the file, returns this line number, starting from 1 And now, the methods of the TextStream object: * Close. Closes an open file. * Read (a number). Reads a specific number of characters from the file. For example, Read(20) reads the first 20 characters within the file being examined. * ReadAll(). Reads the entire file and places it within a text string. * ReadLine(). Reads a single line from the file and places it within a text string. * Skip (a number). Skips over a specific set of characters from the file being examined. * SkipLine. Skips a line when reading from the file being examined. * Write (a string). Writes a specified string to the file being examined. * WriteLine (a string). Writes a string to the file being examined and then writes a newline character within the file. * WriteBlankLines(a number). Writes the specified number of blank lines to the file being examined. The following is an example of the TextStream object in action. Note the location of where you create the file will vary (as well as the name of the actual text file: in this example, it is called "Test2File.txt"), depending on your particular server configuration. Working with the File Object An example of working with the File object!
<% set TestFile=Server.CreateObject("Scripting.FileSystemObject") set TFileStream= TestFile.CreateTextFile( "c:\inetpub\wwwroot\ASP_Examples\Test2File.txt") TFileStream.WriteLine "Welcome to the File Object in ASP!" TFileStream.WriteBlankLines(3) TFileStream.WriteLine "Between this line and the opening line are three blank lines. These blank lines were inserted using the WriteLine method of the TextStream object. Now, let's write three more blank lines before the next section of text is inserted." TFileStream.WriteBlankLines(3) TFileStream.WriteLine "Okay, that's better-three more blank lines have just been inserted! I think you probably get the idea of how to use the WriteLine method, so let's move on to more interesting things." TFileStream.Close %> After the page loads, the Test2File.txt file is created. Navigate to the location of this file - it should look something like this (all the text you asked to be inserted, including the blank lines is included within this file)...

Read article at Internet.com site

Featured Local Company

ClearStar.net

360-892-0687
915 Broadway
Vancouver, WA
http://www.clearstar.net

Regional Articles
- Working with the TextStream Object Anacortes WA
- Working with the TextStream Object Arlington WA
- Working with the TextStream Object Auburn WA
- Working with the TextStream Object Bainbridge Island WA
- Working with the TextStream Object Battle Ground WA
- Working with the TextStream Object Bellevue WA
- Working with the TextStream Object Bellingham WA
- Working with the TextStream Object Bothell WA
- Working with the TextStream Object Bremerton WA
- Working with the TextStream Object Buckley WA
- Working with the TextStream Object Camas WA
- Working with the TextStream Object Chehalis WA
- Working with the TextStream Object Cheney WA
- Working with the TextStream Object East Wenatchee WA
- Working with the TextStream Object Edmonds WA
- Working with the TextStream Object Ellensburg WA
- Working with the TextStream Object Enumclaw WA
- Working with the TextStream Object Everett WA
- Working with the TextStream Object Federal Way WA
- Working with the TextStream Object Gig Harbor WA
- Working with the TextStream Object Issaquah WA
- Working with the TextStream Object Kelso WA
- Working with the TextStream Object Kenmore WA
- Working with the TextStream Object Kennewick WA
- Working with the TextStream Object Kent WA
- Working with the TextStream Object Kirkland WA
- Working with the TextStream Object Lacey WA
- Working with the TextStream Object Lake Stevens WA
- Working with the TextStream Object Lakewood WA
- Working with the TextStream Object Longview WA
- Working with the TextStream Object Lynden WA
- Working with the TextStream Object Lynnwood WA
- Working with the TextStream Object Maple Valley WA
- Working with the TextStream Object Marysville WA
- Working with the TextStream Object Mercer Island WA
- Working with the TextStream Object Moses Lake WA
- Working with the TextStream Object Mount Vernon WA
- Working with the TextStream Object Mountlake Terrace WA
- Working with the TextStream Object Mukilteo WA
- Working with the TextStream Object Oak Harbor WA
- Working with the TextStream Object Olympia WA
- Working with the TextStream Object Pasco WA
- Working with the TextStream Object Port Angeles WA
- Working with the TextStream Object Port Orchard WA
- Working with the TextStream Object Poulsbo WA
- Working with the TextStream Object Pullman WA
- Working with the TextStream Object Puyallup WA
- Working with the TextStream Object Redmond WA
- Working with the TextStream Object Renton WA
- Working with the TextStream Object Richland WA
- Working with the TextStream Object Seattle WA
- Working with the TextStream Object Sedro Woolley WA
- Working with the TextStream Object Selah WA
- Working with the TextStream Object Sequim WA
- Working with the TextStream Object Shelton WA
- Working with the TextStream Object Silverdale WA
- Working with the TextStream Object Snohomish WA
- Working with the TextStream Object Spanaway WA
- Working with the TextStream Object Spokane WA
- Working with the TextStream Object Stanwood WA
- Working with the TextStream Object Sumner WA
- Working with the TextStream Object Tacoma WA
- Working with the TextStream Object University Place WA
- Working with the TextStream Object Vancouver WA
- Working with the TextStream Object Washougal WA
- Working with the TextStream Object Wenatchee WA
- Working with the TextStream Object Woodinville WA
- Working with the TextStream Object Yakima WA
- Working with the TextStream Object Yelm WA
Related Local Events
Intellectual Property: Commercialization & Protection
Dates: 2/17/2010 - 2/17/2010
Location: AHA!
Vancouver, WA
View Details

2010 'The Future is Now' Technology Expo
Dates: 1/27/2010 - 1/27/2010
Location: ShoWare Center
Kent, WA
View Details

Leads Group: Wired
Dates: 12/31/2009 - 12/31/2009
Location: Mud Bay Coffee
Olympia, WA
View Details

Leads Group: Wired
Dates: 12/24/2009 - 12/24/2009
Location: Mud Bay Coffee
Olympia, WA
View Details

Leads Group: Wired
Dates: 12/13/2009 - 12/13/2009
Location: Mud Bay Coffee
Olympia, WA
View Details

Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML