Show 2.dele.asp
<% Wname=trim (Request.QueryString ("name")) ' name for the text file name "wz-n.asp" (n=0,1,2,...) corresponding to the article to be deleted
is also derived from the Wname field in the database
Set Dbconn=server.createobject ("Adodb.connection")
Conpath= "dbq=" &server.mappath ("Wzozg.mdb")
Dbconn. Open "Driver={microsoft Access DRIVER (*.mdb)};" & Conpath
Sql= "Delete from Ozg where wname= '" &wname& "" ' deletes the article information in the database
Dbconn.execute (SQL)
Dbconn.close
Thisfile = Server.MapPath (wname)
Set fs=server.createobject ("Scripting.FileSystemObject")
If Fs. FileExists (Thisfile) Then
Fs. DeleteFile thisfile,true ' Delete the corresponding text file ' wz-n.asp '
End If
Set fs=nothing
%>
3.showwz.asp
<% set Dbconn=server.createobject ("Adodb.connection")
Conpath= "dbq=" &server.mappath (". /.. /db/wzozg.mdb ")
Dbconn. Open "Driver={microsoft Access DRIVER (*.mdb)};" & Conpath
Set Rs=server.createobject ("Adodb.recordset")
Rs.Open sql,dbconn,3,1
Number=rs.recordcount%> ' The general information of all articles into recordset RS
%>
4.wz.asp
<%wname=request.querystring ("Wname") ' the corresponding text file name of the article that comes from showwz.asp to show the content specifically
Set Dbconn=server.createobject ("Adodb.connection")
Conpath= "dbq=" &server.mappath ("Wzozg.mdb")
Dbconn. Open "Driver={microsoft Access DRIVER (*.mdb)};" & Conpath
sql= "Update Ozg set wcount=wcount+1 where wname=" &wname& "
Dbconn. Execute (SQL)
Sql= "Select Wauth,wname,wcontent,wsource,wauth from Ozg where wid=" &id& "
Set Rs=dbconn. Execute (SQL) ' Read the general information of the article you want to display into the recordset
filename = Server.MapPath (wname)
Rs.close
Dbconn. Close
Set fs=createobject ("Scripting.FileSystemObject")
Set thisfile = fs. OpenTextFile (Filename,1,false)
Do as not thisfile. AtEndOfStream
Thisline = Thisfile.readline
If thisline<> "" Then
Thisline=server. HTMLENCODE (Thisline)
Response.Write "<p>" &thisline& "</p>"
End If
Loop
Thisfile.close
Set fs=nothing
%>
---------------------------------------------------
Writen by Aspboy and powered by http://easp.126.com