<!#includefile = "filename.asp"-> 매크로에 의해 제한됩니다
파일은 존재해야하며 사전 컴파일됩니다 (조건이 우선하는지 여부에 관계없이)
다른 요구 사항에 따라 다른 파일을 포함하여 이러한 요구 사항이 종종 있습니다.
각 개인의 설정이 다른 경우 파일을 동적으로 포함해야합니다.
코드는 다음과 같습니다.
functioninclude (filename)
Dimre, Content, FSO, F, Aspstart, Aspend
setfso = createobject ( "Scripting.FilesyStemObject")
setf = fso.opentextfile (server.mappath (filename))
내용 = F. Readall
f.close
setf = 아무것도
setfso = 아무것도
setre = newRegexp
re.pattern = "^/s*="
aspend = 1
aspstart = inst (Aspend, 컨텐츠, "<%")+2
dowhileaspstart> aspend+1
Response.WriteMid (Content, Aspend, Aspstart-Aspend-2)
aspend = instr (aspstart, 컨텐츠, "%/>")+2
execute (re.replace (MID (Content, AspStart, Aspend-AspStart-2), "response.write"))
aspstart = inst (Aspend, 컨텐츠, "<%")+2
고리
Response.WriteMid (Content, Aspend)
setre = 아무것도
최종 기능 장애
사용의 예 :
포함 ( "youinc.asp")