1. How to use Asp to determine the virtual physical path of your website
A: Use the Mappath method.
<P align = "center"> <font size = "4" face = "Arial"> <B>
The Physical path to this virtual website is:
</B> </font>
<Font color = "# FF0000" size = "6" face = "Arial">
<% = Server. MapPath ("\") %>
</Font> </p>
2. How can I know the browser used by the user?
A: Use the Request object method.
StrBrowser = Request. ServerVariables ("HTTP_USER_AGENT ")
If Instr (strBrowser, "MSIE") <> 0 Then
Response. redirect ("ForMSIEOnly.htm ")
Else
Response. redirect ("ForAll.htm ")
End If
3. How to calculate the average number of repeated visits per day
Answer: Solution
<% Startdate = DateDiff ("d", Now, "01/01/1990 ")
If strdate <0 then startdate = startdate *-1
Avgvpd = Int (usercnt)/startdate) %>
Display result
<% Response. write (avgvpd) %>
That is it. this page have been viewed since November 10, 1998
4. How to display random images
<% Dim p, ppic, dpic
Ppic = 12
Randomize
P = Int (ppic * rnd) + 1)
Dpic = "graphix/randompics/" & p & ". gif"
%>
Display
5. How to return to the previous page
A: <a href = "<% = request. serverVariables (" Http_REFERER ") %>"> preivous page </a>
Or use an image, such:
6. How to Determine the IP address of the other party
Answer: <% = Request. serverVariables ("REMOTE_ADDR) %>
7. How to link to an image
A:
<% @ Ages = vbs packages %>
<% Response. expires = 0
Strimagename = "graphix/errors/erroriamge.gif"
Response. redirect (strimagename)
%>
8. Force password input dialog box
A: Put this sentence at the beginning of the page.
& Lt; % response. status = "401 not Authorized"
Response. end
%>