加入收藏 | 设为首页 | 会员中心 | 我要投稿 银川站长网 (https://www.0951zz.com/)- 云通信、基础存储、云上网络、机器学习、视觉智能!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

在 asp 中如何存储数据

发布时间:2023-10-18 13:00:53 所属栏目:Asp教程 来源:
导读:下面我们就来看看实例教程吧. 先来看看提交的页面:<FORM ACTION="saveinfo.asp" METHOD=post><!-- Your fields here --><INPUT TYPE=submit value="Submit"></FORM>下面看看接收数据并保存的页面. <%Set fs = Create

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

 先来看看提交的页面:

<FORM ACTION="saveinfo.asp" METHOD=post>

<!-- Your fields here -->

<INPUT TYPE=submit 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) 

       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 

%>

(编辑:银川站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章