国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp入門:asp如何保存數(shù)據(jù)_ASP教程

2024-05-04 11:04:33
字體:
供稿:網(wǎng)友

推薦:asp簡單文本計(jì)數(shù)器
% Set fs = CreateObject(Scripting.FileSystemObject) Wfile=server.mappath() cgi-binwww.111cn.cn/asp/asp.html.txt on error resume next Set a = fs.OpenTextFile(Wfile) hits = Clng(a.ReadLine) hits = hits + 1 a.close if error then hits = 1 end if Set a =

下面我們就來看看實(shí)例教程吧.

 先來看看提交的頁面:

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

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

下面看看接收數(shù)據(jù)并保存的頁面.

 <%
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 
%>

分享:asp 在線人數(shù)統(tǒng)計(jì)代碼
只要復(fù)制代碼表中到一個(gè)文本文件并將其保存在主目錄中的網(wǎng)站( / Global.asa中 ) 。 SCRIPT LANGUAGE=VBScript RUNAT=Server Sub Application_OnStart application(activevisitors)=0 End Sub Sub Application_OnEnd End Sub Sub Session_OnStart application.lock ap

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 新竹市| 锡林郭勒盟| 霍山县| 邯郸县| 长宁区| 无为县| 绥中县| 渑池县| 蒙阴县| 惠东县| 望奎县| 马公市| 开封县| 荃湾区| 敦化市| 澳门| 安陆市| 云霄县| 新兴县| 特克斯县| 阿图什市| 门头沟区| 南丹县| 柞水县| 泽州县| 北京市| 舟曲县| 沾益县| 安乡县| 上栗县| 新巴尔虎右旗| 沐川县| 修水县| 丰宁| 南昌县| 维西| 泰顺县| 望城县| 灵璧县| 邯郸县| 盐边县|