1.如何用Asp判断你的网站的虚拟物理路径 k<Sl1vK
答:使用Mappath方法 (Hp' B))2
< p align="center" >< font size="4" face="Arial" >< b > 8<dOMp;}r
The Physical path to this virtual website is: f_\_9o"l
< /b >< /font > GP,<`l&
< font color="#FF0000" size="6" face="Arial" > Yl({)qK{
< %= Server.MapPath("\")% > o"+
i&Wp~
< /font >< /p > 1}g:|Q
2.我如何知道使用者所用的浏览器? %SA!p;
答:使用the Request object方法 reiU%C
strBrowser=Request.ServerVariables("HTTP_USER_AGENT") -x]`DQUg
If Instr(strBrowser,"MSIE") < > 0 Then 9-lEt l%
Response.redirect("ForMSIEOnly.htm") 0Y?H0
Else T>d.#
Response.redirect("ForAll.htm") 1FERmf? ?d
End If (! KG)!
;ojiJ?jU
3.如何计算每天的平均反复访问人数 ]<trA$ 0
答:解决方法 Vxdp|
< % startdate=DateDiff("d",Now,"01/01/1990") q=5l4|1
if strdate< 0 then startdate=startdate*-1 ?<%=:
Yh
avgvpd=Int((usercnt)/startdate) % > +U8Bln
显示结果 V3s L;
< % response.write(avgvpd) % > ;Yts\4BSM
that is it.this page have been viewed since November 10,1998 YA&`&$
PkUd~c
4.如何显示随机图象 IVjU`ij
< % dim p,ppic,dpic 7@;">`zvm
ppic=12 ^mPPyT ,(
randomize (03pJV&K
p=Int((ppic*rnd)+1) 8]"(!i_;)
dpic="graphix/randompics/"&p&".gif" ^&