LCMS企业网站管理系统——静态化测试ASP程序
由于Cls_LiuSong类屏蔽了错误输出,所以部分使用者在生成静态后,却没有出现静态页面或目录,所以做这个小程序以便检查错误来源。
放入LCMS企业网站管理系统目录浏览一下:
- 四种测试结果均为 Success 才可以正常生成网站页面;
- 出现ASP错误,请检查错误来源。
关于360杀毒软件误报病毒解释:
LCMS企业网站管理系统,生成静态页面需要"ADODB.Stream"、"Microsoft.XMLHTTP"、"Scripting.FileSystemObject"几个组件。所以我在html_test.asp测试代码简单调用了这几个组件,有用户360杀毒软件报告木马。如果您在使用时,以上几个组件服务时开启的,并且目录安全性可以创建和删除的可以直接将这个core/html_test.asp文件删除。一下是该文件的全部代码:
<%
'---------------------------------------------------------------
' LCMS企业网站管理系统——静态化测试
' 四种测试结果均为 Success 才可以。
' 出现ASP错误,请检查错误来源。
'---------------------------------------------------------------
' 创建目录测试
MD Server.MapPath("k88")
' 删除目录测试
Del Server.MapPath("k88")
' 生成静态页面测试
SaveToFile "http://k88.cn", "", Server.MapPath("k88.html")
' 删除静态页面
Del Server.MapPath("k88.html")
Dim HttpStatus '获取状态
Sub SaveToFile(ByVal HtmlUrl, ByVal PostQueryString, ByVal FilePath)
Dim objStream
Dim HtmlBody
HtmlBody = GetByteHtml(HtmlUrl, PostQueryString)
If HttpStatus = 200 Then
Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
.Type = 1
.Mode = 3
.Open
.Write HtmlBody
.SaveToFile FilePath, 2
.Close
End With
Set objStream = Nothing
Response.Write "SaveToFile test success! "
Else
Response.Write "SaveToFile test fail! "
End If
End Sub
Function GetByteHtml(ByVal HtmlUrl, ByVal PostQueryString)
Dim XmlHttp
' MSXML2.ServerXMLHTTP|Microsoft.XMLHTTP|Msxml2.XMLHTTP.4.0
XmlHttp = "Microsoft.XMLHTTP"
Dim objHttp
Set objHttp = Server.CreateObject(XmlHttp)
'MSXML2.ServerXMLHTTP set(objHttp.setTimeouts 10000,10000,10000,30000)
If PostQueryString > "" Then
objHttp.Open "post", HtmlUrl, False
objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHttp.Send(PostQueryString)
Else
objHttp.Open "get", HtmlUrl, False
objHttp.setRequestHeader "CONTENT-TYPE", "text/html"
objHttp.setRequestHeader "Charset", "utf-8"
objHttp.Send()
End If
HttpStatus = objHttp.Status
If HttpStatus = 200 Then
GetByteHtml = objHttp.ResponseBody
Else
'Response.Write "Test fail!"
End If
Set objHttp = Nothing
End Function
Sub MD(strSysPath)
Dim i
Dim objFile
Dim arrPath
Dim strNoncePath
arrPath = Split(strSysPath, "\")
strNoncePath = arrPath(0)
Set objFile = Server.Createobject("Scripting.FileSystemObject")
For i = 1 To UBound(arrPath)
strNoncePath = strNoncePath & "\" & arrPath(i)
If objFile.FolderExists(strNoncePath) Then
Else
objFile.CreateFolder strNoncePath
End If
Next
Set objFile = Nothing
Response.Write "Create folder """ & strSysPath & """ success! "
End Sub
Sub Del(strSysPath)
Dim objFile
Set objFile = Server.Createobject("Scripting.FileSystemObject")
If objFile.FolderExists(strSysPath) Then
objFile.DeleteFolder strSysPath
Response.Write "Delete folder """ & strSysPath & """ success! "
ElseIf objFile.FileExists(strSysPath) Then
objFile.DeleteFile strSysPath
Response.Write "Delete file """ & strSysPath & """ success! "
End If
Set objFile = Nothing
End Sub
%>