|
|
|
|
|
| | |
|
Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: Wrtiting to files using ASP (on virtual path) |
From: |
Kal |
Date: |
9/23/1999 7:24:21 PM |
IP: |
131.107.3.74 |
<html><head>
<TITLE>txtwrite.asp</TITLE>
</head><body bgcolor="#FFFFFF">
<%
whichname="tempfile.txt"
whichdir=Server.Mappath ("/upload/tests/")
whichFN=whichdir & whichname
first, create the file out of thin air
Set fstemp = Server.CreateObject "Scripting.FileSystemObject")
Set filetemp = fstemp.CreateTextFile(whichFN, true)
true = file can be over-written if it exists
false = file CANNOT be over-written if it exists
filetemp.WriteLine("This is a brand new file!!!!")
filetemp.writeblanklines(3)
filetemp.WriteLine("This is the last line of the file we created!")
filetemp.Close
Now open it and add some lines
forappending =8
set filetemp=fstemp.OpentextFile(whichFN, forappending)
filetemp.writeline "a line we added later"
filetemp.writeline "another line we added later..."
filetemp.close
set filetemp=nothing
set fstemp=nothing
If err.number=0 then
response.write "File was appended sucessfully!"
else
response.write "VBScript Errors Occured!<br>"
response.write "Error Number=#<b>" & err.number & "</b><br>"
response.write "Error Desc. =<b>" & err.description & "</b><br>"
response.write "Help Path =<b>" & err.helppath & "</b><br>"
response.write "Native Error=<b>" & err.nativeerror & "</b><br>"
response.write "Error Source =<b>" & err.source & "</b><br>"
response.write "SQL State=ð/LM/W3SVC/4/Root |
Previous Message
Follow Up - Perfect Solution - Vivek Joshi 9/25/1999 12:20:40 AM
|
|

|
|
|
|
|
|
|
|
|
|