<!#clusefile = "filename.asp" - > macroによって制限されています
ファイルが存在する必要があり、条件が先行するかどうかに関係なく、事前補償されます)
多くの場合、さまざまな要件に応じた異なるファイルを含むそのような要件があります
各個人の設定が異なる場合、ファイルを動的に含める必要があります。
コードは次のとおりです。
functioninclude(filename)
dimre、content、fso、f、aspstart、aspend
setFSO = createObject( "Scripting.filesystemObject")
setf = fso.opentextfile(server.mappath(filename)))
content = f.readall
f.close
setf = Nothing
setfso =何もない
setre = newRegexp
re.pattern = "^/s*="
Aspend = 1
ASPSTART = Instr(Aspend、content、 "<%")+2
dowhileaspstart> aspend+1
Response.Writemid(content、aspend、aspstart-aspend-2)
aspend = strunt(aspstart、content、 "%/>")+2
execute(re.replace(Mid(content、aspstart、aspend-aspstart-2)、 "respons.write"))
ASPSTART = Instr(Aspend、content、 "<%")+2
ループ
respons.writemid(content、aspend)
setre =何もない
エンド機能
使用例:
含める( "youinc.asp")