You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
109 lines
2.1 KiB
Plaintext
109 lines
2.1 KiB
Plaintext
<%
|
|
Response.Charset = "utf-8"
|
|
Session.CodePage = 65001
|
|
|
|
'动态加载CSS和JS by shw
|
|
|
|
dim loadCache
|
|
dim loadVersion
|
|
dim loadType
|
|
dim loadPath
|
|
dim loadFile
|
|
|
|
loadType=request.QueryString("t")
|
|
|
|
loadFile=request.QueryString("f")
|
|
|
|
loadVersion=request.QueryString("v")
|
|
|
|
'确认后缀名
|
|
select case loadType
|
|
case "css"
|
|
loadType=".css"
|
|
response.ContentType ="text/css"
|
|
replaceType=vbCrLf
|
|
case "js"
|
|
loadType=".js"
|
|
response.ContentType ="text/javascript"
|
|
replaceType=""
|
|
case else
|
|
loadType=".css"
|
|
response.ContentType ="text/css"
|
|
replaceType=vbCrLf
|
|
end select
|
|
|
|
loadFile=split(loadFile,",")
|
|
|
|
'循环加载开始
|
|
for i=0 to ubound(loadFile)
|
|
nowFile=replace(replace(loadFile(i)&loadType,"_","/"),"@","_")
|
|
nowData=Read(nowFile)
|
|
loadCache=loadCache&nowData&chr(10)
|
|
next
|
|
loadCache=replace(loadCache,replaceType,"")
|
|
|
|
'输出
|
|
response.Write(loadCache)
|
|
response.End()
|
|
|
|
'读取文件
|
|
Function Read( xVar )
|
|
xVar = Server.Mappath(xVar)
|
|
Set Sys = Server.CreateObject("Scripting.FileSystemObject")
|
|
If Sys.FileExists( xVar ) Then
|
|
set stm=server.CreateObject("adodb.stream")
|
|
stm.Type=2
|
|
stm.mode=3
|
|
stm.charset="utf-8"
|
|
stm.open
|
|
stm.loadfromfile xVar
|
|
str=stm.readtext
|
|
stm.Close
|
|
set stm=nothing
|
|
msg=str
|
|
Else
|
|
if isDemo=true then
|
|
msg = "none"
|
|
end if
|
|
End If
|
|
Set Sys = Nothing
|
|
Read = msg
|
|
End Function
|
|
|
|
'写入文件
|
|
Function WriteFile(filename)
|
|
set stm=server.CreateObject("adodb.stream")
|
|
filepathx=Server.Mappath(filename)
|
|
stm.Type=2
|
|
stm.mode=3
|
|
stm.charset="utf-8"
|
|
stm.open
|
|
stm.WriteText list
|
|
stm.SaveToFile filepathx,2
|
|
stm.flush
|
|
stm.Close
|
|
set stm=nothing
|
|
End Function
|
|
|
|
'检测文件是否存在
|
|
Function ReportFileStatus(FileName)
|
|
set fso = server.createobject("scripting.filesystemobject")
|
|
if fso.fileexists(FileName) = true then
|
|
ReportFileStatus=true
|
|
else
|
|
ReportFileStatus=false
|
|
end if
|
|
set fso=nothing
|
|
end function
|
|
|
|
'删除文件
|
|
function del_file(path)
|
|
set objfso = server.createobject("scripting.FileSystemObject")
|
|
'path=Server.MapPath(path)
|
|
if objfso.FileExists(path) then
|
|
objfso.DeleteFile(path)
|
|
end if
|
|
set objfso = nothing
|
|
end function
|
|
%>
|