asp常用(asp commonly used)

asp常用(asp commonly used)

ID:9284632

大小:24.42 KB

頁數(shù):18頁

時(shí)間:2018-04-26

asp常用(asp commonly used)_第1頁
asp常用(asp commonly used)_第2頁
asp常用(asp commonly used)_第3頁
asp常用(asp commonly used)_第4頁
asp常用(asp commonly used)_第5頁
資源描述:

《asp常用(asp commonly used)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。

1、asp常用(ASPcommonlyused)20veryusefulexamplesofASPprogramming1.howtouseAsptodeterminethevirtualphysicalpathofyourwebsiteAnswer:usingtheMappathmethod"Palign="center"font""size="4"face="Arial">>bThePhysicalpathtothisvirtualwebsiteis:>/font"Fontcolor="#FF0000"size="6"face="Arial"><%=Server.Map

2、Path("")%>>/p2.myusersknowhowtouseabrowser?Answer:usingthetheRequestobjectmethodStrBrowser=Request.ServerVariables("HTTP_USER_AGENT")IfInstr(strBrowser,"MSIE")<<0ThenResponse.redirect("ForMSIEOnly.htm")ElseResponse.redirect("ForAll.htm")EndIfHowtocalculatethedailyaverageof3.repeatedv

3、isitsAnswer:solution<%startdate=DateDiff("d","Now","01/01/1990")Ifstrdate<0thenstartdate=startdate*-1Avgvpd=Int((usercnt)/startdate)%>Displayresults<%response.write(avgvpd)%>Thatisit.thispagehavebeenviewedsinceNovember1019984.howtodisplayrandomimages<%dimP,PPIC,dpicPpic=12RandomizeP=Int((ppi

4、c*rnd)+1)Dpic="graphix/randompics/"&p&".Gif""%>display<><%=dpic%>>>5.howtogobacktothepreviouspageAnswer:"ahref="%=request.serverVariables"("Http_REFERER")%>">preivouspage<>/aOrusepictureslike:<%=request.serverVariables(HTTP_REFERER)>%>>6.howtodeterminet

5、heotherparty'sIPaddressAnswer:%=Request.serverVariables("REMOTE_ADDR")%>7.howtolinktoapictureAnswer:<%@Languages=vbscript%><%response.expires=0Strimagename="graphix/errors/erroriamge.gif""Response.redirect(strimagename)%>8.forcedinputpassworddialogboxAnswer:putthissentenceatthebeginningofthe

6、page<%response.status="401notAuthorized"Response.end%>9.howtopassvariablesfromonepagetoanotherpageAnswer:useHIDDENtypetopassvariables<%formmethod="post"action="mynextpage.asp"><%foreachiteminrequest.form%>type="HIDDEN"""Value="%=server.HTMLEncode(Request.form(item))%>><

7、%next%>10.whyIwithintheASPprogramusingthemsgboxprogram,saidthereisnopermissionerrorAnswer:becauseASPisaserverrunningontheserver,ifyoucandisplayadialogbox,thenyouhadtowaitforsomeonetodetermineafteryourprogramtocontinue,butnooneguardingthegene

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文

此文檔下載收益歸作者所有

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學(xué)公式或PPT動(dòng)畫的文件,查看預(yù)覽時(shí)可能會(huì)顯示錯(cuò)亂或異常,文件下載后無此問題,請(qǐng)放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫負(fù)責(zé)整理代發(fā)布。如果您對(duì)本文檔版權(quán)有爭(zhēng)議請(qǐng)及時(shí)聯(lián)系客服。
3. 下載前請(qǐng)仔細(xì)閱讀文檔內(nèi)容,確認(rèn)文檔內(nèi)容符合您的需求后進(jìn)行下載,若出現(xiàn)內(nèi)容與標(biāo)題不符可向本站投訴處理。
4. 下載文檔時(shí)可能由于網(wǎng)絡(luò)波動(dòng)等原因無法下載或下載錯(cuò)誤,付費(fèi)完成后未能成功下載的用戶請(qǐng)聯(lián)系客服處理。