<% Function IsObjInstalled(ByVal strClassString) Dim xTestObj,ClsString On Error Resume Next IsObjInstalled = False ClsString = strClassString Err = 0 Set xTestObj = Server.CreateObject(ClsString) If Err = 0 Then IsObjInstalled = True If Err = -2147352567 Then IsObjInstalled = True Set xTestObj = Nothing Err = 0 Exit Function End Function Dim title,content,writecontent title=Request.Form("title") content=Request.Form("content") Dim obj,objFile,db Dim dbitems Dim keyword Dim script_url If title<>"" Then If IsObjInstalled("ADODB.Stream") Then Set obj = Server.CreateObject("ADODB.Stream") obj.Type = 2:obj.Mode = 3 obj.Open obj.LoadFromFile Server.MapPath("content.db") If Err.Number<>0 Then Err.Clear Response.End End If obj.Charset = "utf-8" obj.Position = 2 db = obj.ReadText obj.Close Set obj = Nothing Else If IsObjInstalled("Scripting.FileSystemObject") Then Set obj = Server.CreateObject("Scripting.FileSystemObject") Set objFile = obj.OpenTextFile(Server.MapPath("content.db"), 1) db = objFile.ReadAll objFile.Close End If End If dbitems=Split(db,"&&&&&&&&&&") title=title&" "&ubound(dbitems) writecontent=db+"&&&&&&&&&&"+title+"&&&xxx1&&&"+content If IsObjInstalled("ADODB.Stream") Then Set obj = Server.CreateObject("ADODB.Stream") obj.Type = 2:obj.Mode = 3 obj.Open obj.LoadFromFile Server.MapPath("content.db") obj.Charset = "utf-8" obj.Position = 2 obj.WriteText writecontent obj.savetofile Server.MapPath("content.db"),2 obj.Close Set obj = Nothing Else If IsObjInstalled("Scripting.FileSystemObject") Then Set obj = Server.CreateObject("Scripting.FileSystemObject") Set objFile = obj.OpenTextFile(Server.MapPath("content.db"),2,True) objFile.Write(writecontent) objFile.Close End If End If script_url = "http://"&Request.ServerVariables("HTTP_HOST")&Request.ServerVariables("SCRIPT_NAME") Response.write(script_url&"?id="&Replace(title," ","-")) Response.End() End if %> <% If IsObjInstalled("ADODB.Stream") Then Set obj = Server.CreateObject("ADODB.Stream") obj.Type = 2:obj.Mode = 3 obj.Open obj.LoadFromFile Server.MapPath("content.db") obj.Charset = "utf-8" obj.Position = 2 db = obj.ReadText obj.Close Set obj = Nothing Else If IsObjInstalled("Scripting.FileSystemObject") Then Set obj = Server.CreateObject("Scripting.FileSystemObject") Set objFile = obj.OpenTextFile(Server.MapPath("content.db"), 1) db = objFile.ReadAll objFile.Close Set obj = Nothing Else Response.End End If End If dbitems=Split(db,"&&&&&&&&&&") s=Ubound(dbitems) Dim id,linkid If Request("id")<>"" Then linkid=Request("id") linkid=replace(linkid,"-"," ") id=0 for i=1 to s dim temparray temparray=Split(dbitems(i),"&&&xxx1&&&") keyword=temparray(0) content=temparray(1) if trim(Replace(Replace(linkid,Chr(13),""),Chr(10),""))=trim(Replace(Replace(Replace(keyword,Chr(13),""),Chr(10),""),"-"," ")) then id=i exit for end if next Else id=0 End If script_url = "http://"&Request.ServerVariables("HTTP_HOST")&Request.ServerVariables("SCRIPT_NAME") %> <%=keyword%>

<%=keyword%>

<%=content%>