asp

位置:IT落伍者 >> asp >> 浏览文章

asp入门:asp如何保存数据


发布日期:2021年06月05日
 
asp入门:asp如何保存数据

下面我们就来看看实例教程吧

先来看看提交的页面:

<FORM ACTION="saveinfoasp" METHOD=post>
<! Your fields here >

<INPUT TYPE=submit value="Submit">
</FORM>

下面看看接收数据并保存的页面

<%
Set fs = CreateObject("ScriptingFileSystemObject")
Folderpath=servermappath("") & "/cgibin/messages"
Wcounter=Folderpath &"/countertxt"

Set fs = CreateObject("ScriptingFileSystemObject")
if fsFolderExists(Folderpath) then
Set a = fsOpenTextFile(Wcounter)
hits = Clng(aReadLine)
hits = hits +
aclose
else
Set a = fsCreateFolder(Folderpath)
hits=
end if

Set a = fsCreateTextFile(WcounterTrue)
aWriteLine(hits)
aClose
Set fs=nothing

Set fs = CreateObject("ScriptingFileSystemObject")
Set a = fsCreateTextFile(Folderpath & "" & hits & "txt")
For Each x In RequestForm
aWriteLine(x &": " & RequestForm(x))
Next
aClose
Set a=nothing
Set fs=nothing
%>

上一篇:asp exit用法与exit实例教程

下一篇:asp 把UTF8转换GB2312代码