2、-------------------------------'openfileprocedurefunction'FunctionOpenfile(URL)Dim,fileurl,mfile,content,FSOFileurl=Server.MapPath(URL)SetFso=Server.CreateObject('Scripting.Filesystemobject')'definesFSO"Setmfile=Fso.OpenTextFile(fileurl,1)"opensthefileinreadmodeIfNotmfile.AtEndOfStreamThenC
3、ontent=mfile.ReadAll()readallofthecontentEndIfMfile.CloseOpenFile=contentEndFunction'----------------------------------------------------ThelegendaryRS...NoexplanationSetrs=Server.CreateObject("ADODB.RecordSet")SQL="select*,from,Table_News,order,sys_id,DESC,by".Thisisthenameofthenameinmydat
4、abase.PleasechangeitbyyourselfRs.Open,SQL,Conn,1,1'----------------------------------------------------"Tomakeajudgment,thisexampleisonlytoachieveeffect,pleaseincreaseyourownsecuritydetectionRsnum=rs.recordcount'toreadallthedatainthedatabasejusttobeabletodisplaynormallyPage=CInt(request.For
5、m('page'))'takesthenumberofpagesintheformtogenerateFolder=Trim(request.Form("folder")).Createfolderoptionsintheform.Notethatthereisnodetectionhere.It'sasecurityhazard'----------------------------------------------------'userinputundersimplejudgmentIfIsNumeric(page)=falseThen"Response.Writep
6、age&""nonnumeric".Pleasere-enter!"Response.End()ElseIfPage>rsnumThenPage=rsnumEndIfEndIfIfpage="Then"Page=rsnumEndIf'----------------------------------------------------'simplyjudgewhethertousethedefaultfolderIfFolder="Then"Folder="news""EndIf'-----------------------------------------------
7、-----ForI=1,To,page'startprocessingvariableshereandgetresults“----------------------------------------------------“下面的幾個賦值變量我就不解釋了吧?關(guān)鍵詞=RS(“news_keyword”)標(biāo)題=RS(“news_topic”)身體=RS(“news_content”)底=RS(“news_time”)“刪掉不用開始“當(dāng)時為了做上一篇下一篇的演示,做了左右和美元美元,可以不用“-----