https://www.jmqz1000.com

asp入门-asp如何保存、数据

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

先来看看提交的页面:

FORM ACTION= saveinfo.asp METHOD=post
!-- Your fields here --

INPUT TYPE=submit html' target='_blank'>value= Submit
/FORM

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

%
Set fs = CreateObject( Scripting.FileSystemObject )
Folderpath=server.mappath( ) /cgi-bin/messages143718
Wcounter=Folderpath /counter.txt

Set fs = CreateObject( Scripting.FileSystemObject )
if fs.FolderExists(Folderpath) then
Set a = fs.OpenTextFile(Wcounter)
hits = Clng(a.ReadLine)
中国历史文化[www.9-39.com/html/china/] hits = hits + 1
a.close
else
Set a = fs.CreateFolder(Folderpath)
hits=1
end if

Set a = fs.CreateTextFile(Wcounter,True)
a.WriteLine(hits)
a.Close
Set fs=nothing

Set fs = CreateObject( Scripting.FileSystemObject )
Set a = fs.CreateTextFile(Folderpath hits .txt )
For Each x In Request.Form
a.WriteLine(x : Request.Form(x))
Next
a.Close
Set a=nothing
Set fs=nothing
%

郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。

相关文章阅读