ASP編程中15個非常有用的例子(一)_ASP教程
推薦:Asp三級聯(lián)動下拉菜單數(shù)據(jù)庫版(含源程序)% OptionExplicit ’數(shù)據(jù)庫: ’location ’表1loaction所在的市表 ’字段 ’loactionid(主鍵) ’loactionname名字 ’表2district所在的縣表 ’字段 ’locationid(主鍵) ’districtid ’districtname ’表3village所在的鄉(xiāng)鎮(zhèn)表 ’字段 ’districtid(主鍵
1.如何用Asp判斷你的網(wǎng)站的虛擬物理路徑
答 使用Mappath方法
<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.我如何知道使用者所用的瀏覽器?
答 使用the Request object方法
strBrowser=Request.ServerVariables("HTTP_USER_AGENT")
If Instr(strBrowser,"MSIE") <> 0 Then
Response.redirect("ForMSIEOnly.htm")
Else
Response.redirect("ForAll.htm")
End If
3。如何計算每天的平均反復(fù)訪問人數(shù)
答 解決方法
<% startdate=DateDiff("d",Now,"01/01/1990")
if strdate<0 then startdate=startdate*-1
avgvpd=Int((usercnt)/startdate) %>
顯示結(jié)果
<% response.write(avgvpd) %>
that is it.this page have been viewed since November 10,1998 分享:關(guān)于阻止灌水留言的一個方法(隨機生成的4位認(rèn)證碼)原理:在每次提交留言的時候,要輸入隨機生成的4位認(rèn)證碼. 以下代碼用在ASP 生成隨機4位數(shù): % dim key randomize timer key=Int((8999)*Rnd +1000) % 在表單里顯示: 認(rèn)證碼:%=key% input type=text name=rekey size=8 maxlength=4 input value=%=key
- asp FSO 讀寫文件本文件實現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫實現(xiàn)代碼
- asp中正則表達(dá)式過濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁模板:ASP內(nèi)建對象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個小技巧
- eWebEditor v3.8 列目錄
- ASP無組件分頁實現(xiàn)思路及代碼
- 相關(guān)鏈接:
- 教程說明:
ASP教程-ASP編程中15個非常有用的例子(一)
。