Server
1, customize a content class such as: Urn:contentclasses:document1
There are custom attributes: Clicknumber
2, the content class for the document you are building is defined as 1.
3, establish a form registration
Urn:schemas-microsoft-com:office:forms#contentclass for the 1 established urn:contentclasses:document1
Urn:schemas-microsoft-com:office:forms#cmd for *
Urn:schemas-microsoft-com:office:forms#formurl for chkopen.asp
Urn:schemas-microsoft-com:office:forms#executeurl for chkopen.asp
Urn:schemas-microsoft-com:office:forms#binding Server
4,list.asp
<%
Function addquotes (strvalue)
Const QUOTE = "" "" "
Addquotes = _
QUOTE _
& Replace (strvalue, QUOTE, QUOTE & QUOTE) _
& QUOTE
End Function
Dim CNN ' as ADODB. Connection
Dim rst ' as ADODB. Recordset
Dim urlfld ' as String
Dim strSQL ' as String
URLFLD = "http://aaa.com/fld1/"
Set cnn = CreateObject ("ADODB.") Connection ")
With CNN
. Provider = "Exoledb.datasource"
. Open URLFLD
End With
strSQL = "Select" & _
Addquotes ("Dav:displayname") & "," & _
Addquotes ("Dav:contentclass") & "," & _
Addquotes ("Clicknumber") & "," & _
Addquotes ("Dav:href")
strSQL = strSQL & _
"From SCOPE (' Shallow Traversal of" & _
Addquotes (URLFLD) & "')"
strSQL = strSQL & _
"WHERE" & Addquotes ("Dav:contentclass") & _
"= ' urn:contentclasses:document1 '"
strSQL = strSQL & _
"Order BY" & Addquotes ("Dav:displayname")
Set rst = CreateObject ("ADODB.") Recordset ")
With RST
. Open strSQL, CNN
End With
Response. Write "<table>"
Do Until rst. Eof
Response. Write "<tr><td width=200>"
%>
<a href= ". /fld1/<%=rst. Fields ("Dav:displayname")%> "></a>
<%
Response. Write "</td></tr>"
Rst. MoveNext
Loop
Response. Write "</table>"
Rst. Close
Cnn. Close
Set rst = Nothing
Set cnn = Nothing
%>
5,chkopen.asp
<%
Dim Rec
Dim II
Dim CNN
Dim strURL
Strdataurl = Request.QueryString ("Dataurl")
Set cnn = CreateObject ("Adodb.connection")
With CNN
. Provider = "Exoledb.datasource"
. Open Strdataurl
End With
Set rec = server. CreateObject ("Adodb.record")
Rec. Open Strdataurl, CNN, 3 ' adModeReadWrite
Ii=rec.fields ("Clicknumber")
Rec.fields ("Clicknumber") =ii+1
Rec.fields.update
Rec.close
%>
Open item .....
Run list.asp
Call Chkopen.asp when the file is clicked so that clicknumber+1 opens the file at the same time. Its URL is completed by Strdataurl = Request.QueryString ("Dataurl").