#include void main { float R1,R2,Rp,Rs; scanf("%f%f",&R1,&

#include void main() { float R1,R2,Rp,Rs; scanf("%f%f",&R1,&R2); Rp=R1*R2/(R1+R2); Rs=R1+

问答/196℃/2025-02-06 13:55:02

优质解答:

的方法,这种方法在以前的版本中是不存在的.

<include file="<%=var%>.asp">这种用法是不行的.

凡是include语句,都不可以使用asp变量,参见《ASP宝典》.

但你一定要用include,也是有方法的:

思路:把<include file="<%=var%>.asp">整个作为一个字符串变量,然后自己写需要显示的asp程序.

比如需要动态显示、含有include的文件是MyProduct.asp

那么在转到MyProduct.asp之前,我在另一个文件中写入:

如:

<%

写入文件名变量

FilePath="../viewreports/info"&pid&".htm"

''将文件写入myproduct.asp以供调用

set fs=server.CreateObject("Scripting.FileSystemObject")

AbPath=Server.MapPath("/mysite/viewreports/MyProduct.asp")

set ts=fs.CreateTextFile(AbPath,true)

TxtStr="<html><body><table><!--#include File=""" & FilePath & """ --></table></body></html>"

ts.writeline TxtStr

ts.close

set ts=nothing

set fs=nothing

''将页面转向myproduct.asp

response.redirect "/mysite/viewreports/MyProduct.asp"

end if

%>

我来回答

猜你喜欢

Copyright © 作文乐园 Inc.
Www.821218.Com All Rights Reserved
网站、品牌合作请联系