|
服务端VBScript与JScript几个相同写法(2) } $xml=null; Response.Write(sitekeyWords); %>
3. 动态包含文件 3.1 VBScript 动态包含文件
linenum <% function fInclude(filepath) ' sample call '''/// execute fInclude("include/system/language/"&sitefglang&"/main.asp") \\\''' dim cnt cnt=CreateObject("scripting.fileSystemObject").openTextFile(server.MapPath(filepath)).readall cnt=replace(cnt,"<"&chr(37),"") cnt=replace(cnt,chr(37)&">","") fInclude=cnt end function 'shawl.qiu code' execute fInclude("include/system/language/"&sitefglang&"/main.asp") %>
3.2 JScript 动态包含文
linenum
<% eval($dynInc('aj2.asp')); Response.Write($test); function $dynInc($fl){ /* ------------------------------------\ * 服务端 JScript 动态包含文件 By shawl.qiu * sample call: eval($dynInc('aj2.asp')); \*------------------------------------*/ var $fso=new ActiveXObject("scripting.fileSystemObject"); $str=$fso.OpenTextFile(Server.MapPath($fl)).ReadAll();
|