1.如何用Asp判断你的网站的虚拟物理路径 Y)DAR83
答:使用Mappath方法 WW.@S5
< p align="center" >< font size="4" face="Arial" >< b > #|4G,!
The Physical path to this virtual website is: d)S`.Q
< /b >< /font > Q-<Qm ?
< font color="#FF0000" size="6" face="Arial" > PW|=IPS
< %= Server.MapPath("\")% > 4(sHUWT
< /font >< /p > 67hfv e
2.我如何知道使用者所用的浏览器?
`!t-$i
答:使用the Request object方法 e'>q( B
strBrowser=Request.ServerVariables("HTTP_USER_AGENT") 9Vqy<7i1
If Instr(strBrowser,"MSIE") < > 0 Then T>]T=
Response.redirect("ForMSIEOnly.htm") &e6UEG
Else ^GAJ9AF@(
Response.redirect("ForAll.htm") #M{qMJHDo
End If hf]m'5pb
PxgJ7d
3.如何计算每天的平均反复访问人数 O^3kPVr
答:解决方法 h}!9?:E
< % startdate=DateDiff("d",Now,"01/01/1990") F|{uA/P{
if strdate< 0 then startdate=startdate*-1 S
:8
avgvpd=Int((usercnt)/startdate) % > yq49fEgc@U
显示结果 L-}J=n\
< % response.write(avgvpd) % > 9Q^cE\j
that is it.this page have been viewed since November 10,1998 y] c1x=x
CvmIDRP*
4.如何显示随机图象 mE`qA*=?
< % dim p,ppic,dpic [nZIV
ppic=12 9sT5l"?g
randomize (5 @H
p=Int((ppic*rnd)+1) zxx\jpBBk
dpic="graphix/randompics/"&p&".gif" z4:<?K
% > y/y~<-|<@
显示 qxb]UV,R
< img src="< %=dpic% >" > GyWa=KW.u
5LB{b]w7m
5.如何回到先前的页面 ?"r=08
答:< a href="< %=request.serverVariables("Http_REFERER")% >" >preivous page< /a > QOo'Iv+EL
或用图片如:< img src="arrowback.gif" alt="< %=request.serverVariables("HTTP_REFERER")% >" > u*v<