The file must be present in the macro limit must be pre-compiled (regardless of whether it is conditioned in front)
There are often such requirements, requiring the number of different files such as the individual people according to different requirements, so it is required to dynamically include files.
The code is as follows: <% Function include (filename) DIM Re, Content, FSO, F, ASPSTART, Aspend
SET FSO = CREATEOBJECT ("scripting.filesystemObject") set f = fso.opentextfile (server.mappath (filename)) Content = f.readall f.close set f = nothing set fso = nothing
Set re = new regexp Re.pattern = "^ / s * =" aspend = 1 aspstart = INSTR (Aspend, Content, "<%") 2 do while aspstart> Aspend 1 Response.write MID (Content, Aspend, Aspend = INSTR (ASPSTART, Content, "% />") 2 Execute (Re.Replace (MID (Content, ASPSTART, Aspend-AsPstart-2), "Response.Write") ASPStart = INSTR (Aspend, Content, "<%") 2 loop response.write mid (content, aspend) set re = nothingend function%>
Example of use: include ("Youinc.asp")