Article ID: 180824
Article Last Modified on 12/1/2000
174185 FP98: ASP Code Displayed in Browser
<H3> Thank you for submitting your information </H3>
<%
'-----------------------------------------------------
' FileSystemObject constants include file for VBScript
'-----------------------------------------------------
'---- iomode Values ----
Const ForAppending = 8
Const ForReading = 1
Const ForWriting = 2
'---- format Values ----
Const TristateFalse = 0
Const TristateMixed = -2
Const TristateTrue = -1
Const TristateUseDefault = -2
' If the file already exists, then an error will be generated.
' This line permits the program to continue executing on error.
On error Resume next
' Create the scripting object.
set objfso = createobject("scripting.FileSystemObject")
' Create the text file. If the file already exists, then an error
' will be generated.
set myobject = objfso.createtextfile("c:\public\myfile.txt", false)
' Open the file for scripting. If it does not exist, setting
' the third parameter (Create) to true will cause it to be created
set myobject = objfso.opentextfile ("c:\public\myfile.txt", forappending, true )
'Calculate the total price.
quantity = request.form("quantity")
price = request.form("price")
totalprice = quantity * price
' Assign the submitted form results to a variable.
productdata = request.form("name") & "," & request.form("product") &
"," & request.form("quantity") & "," & request.form("price") & "," &
totalprice
' Write the form results to the file.
myobject.writeline(productdata)
' Close the object.
myobject.close
%>163009 Values for Scripting Object Constants Defined
Additional query words: 98
Keywords: kbhowto KB180824