Counter (Database Storage)

xiaoxiao2021-03-06  87

<%

// Program name: counter // Author: magicfox // Time: 10/14/2004

Function setcount () {var sql, dataset; var dataset; var = new error (); var result

DataSet = Server.createObject ("adoDb.recordset"); SQL = "Select Count from counter"; dataset.open (SQL, Dataconn, 1, 1); if (err.number! = 0) {} else {result = DataSet ("count"). Value; dataset.close; sql = "Update counter set count = count 1"; Dataconn.execute (SQL);} return (result);

Function showcount (num) {

Var J, I, Num; VAR TMP = New String ();

TMP = Num.Tostring (); j = tmp.Length; i = 1; response.write ("You are this site No. "); while (i <= (8- J)) {response.write ("0"); i = i 1;}

Response.write (Num " bit");}

Function counter () {this.count = 0; this.Setcount = setCount; this.showcount = showcount;}%>

转载请注明原文地址:https://www.9cbs.com/read-105504.html

New Post(0)