建站代码网

热门标签

动态包含inc/include文件

<% Function getMappedFileAsString(byVal strFilename) Const ForReading = 1 Dim fso Set fso = Server.CreateObject("scripting.FilesystemObject") Dim ts Set ts = fso.OpenTextFile(Server.MapPath(strFilename), ForReading) getMappedFileAsString = ts.ReadAll ts.close Set ts = nothing Set fso = Nothing End Function Select Case cstr(session("pc")) Case "1" incfile="../ttasp/common/ttasp_print_select.inc" Case "2" incfile="../ttasp/common/ttasp_print_select2.inc" Case "3" incfile="../ttasp/common/ttasp_print_select3.inc" Case else incfile="../ttasp/common/ttasp_print_select.inc" End Select strInclude = getMappedFileAsString(incfile) Execute strInclude %>

inc文件只能是代码块 不能包含代码块开始结束符

X