ASP OpenAsTextStream Method
Complete File Object Reference
The OpenAsTextStream method opens the specified file and returns a TextStream object to access the file.
Syntax
| FileObject.OpenAsTextStream(mode,format) |
| Parameter |
Description |
| mode |
Optional. How to open the file.
- 1 = ForReading - Open a file for reading. You cannot write to this file
- 2 = ForWriting - Open a file for writing
- 8 = ForAppending - Open a file and write to the end of the file
|
| format |
Optional. The format of the file.
- 0 = TristateFalse - Default. Open the file as ASCII
- -1 = TristateTrue - Open the file as Unicode
- -2 = TristateUseDefault - Open the file using the system default
|
Example
<%
dim fs,f,ts
set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.GetFile("c:\test.txt")
Set ts=f.OpenAsTextStream(ForWriting)
ts.Write("Hello World!")
ts.Close
Set ts=f.OpenAsTextStream(ForReading)
Response.Write(ts.ReadAll)
ts.Close
set ts=nothing
set f=nothing
set fs=nothing
%>
Output:
Hello World!
|
Complete File Object Reference
 |
 |
 |
 |
|
The Ektron Intranet
lets you do everything you need to do on your corporate intranet and everything you want to do... all with just one application.
What can you do with the Ektron Intranet? |
 |
Navigate through content, documents, assets, colleagues and workgroups quickly and intuitively with enterprise search |
 |
Communicate with friends and colleagues with forums, message boards and corporate blogging using the new Social Networking Platform |

|
Utilize the extensive out-of-the box features or customize your site through Ektron CMS400.NET's open architecture |
 |
Promote collaboration in your organization through project workspaces where others can efficiently find information and work together |
 |
Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management |
|
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
|
|
 |
TAKE THE VIDEO TOUR |
 |
or download a FREE TRIAL today. |
|