ASP缂栫▼涓20涓闈炲父鏈夌敤鐨勪緥瀛恄鏂囨。涓嬭浇
1.濡備綍鐢╝sp鍒ゆ柇浣犵殑缃戠珯鐨勮櫄鎷熺墿鐞嗚矾寰
銆銆绛旓細浣跨敤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.濡備綍璁$畻姣忓ぉ鐨勫钩鍧囧弽澶嶈块棶浜烘暟
銆銆绛旓細瑙e喅鏂规硶
銆銆<% startdate=DateDiff("d",Now,"01/01/1990")
銆銆if strdate< 0 then startdate=startdate*-1
銆銆avgvpd=Int((usercnt)/startdate) % >
銆銆鏄剧ず缁撴灉
銆銆<% response.write(avgvpd) %>
銆銆that is it.this page have been viewed since November 10,1998
銆銆4.濡備綍鏄剧ず闅忔満鍥捐薄
銆銆<% dim p,ppic,dpic
銆銆ppic=12
銆銆randomize
銆銆p=Int((ppic*rnd)+1)
銆銆dpic="graphix/randompics/"&p&".gif"
銆銆%>
銆銆鏄剧ず
銆銆<img src="< %=dpic% >">
銆銆5.濡備綍鍥炲埌鍏堝墠鐨勯〉闈
銆銆绛旓細<a href="< %=request.serverVariables("Http_REFERER")%
>" >preivous page< /a >
鎴栫敤鍥剧墖濡傦細< img src="arrowback.gif" alt="< %=request.serverVariables("HTTP_REFERER")%
>" >
銆銆6.濡備綍纭瀹氬规柟鐨処P鍦板潃
銆銆绛旓細<%=Request.serverVariables("REMOTE_ADDR)%>
銆銆7.濡備綍閾剧粨鍒颁竴鍓鍥剧墖涓
銆銆绛旓細
銆銆<% @Languages=vbs cript % >
銆銆<% response.expires=0
銆銆strimagename="graphix/errors/erroriamge.gif"
銆銆response.redirect(strimagename)
銆銆%>
銆銆8.寮鸿揩杈撳叆瀵嗙爜瀵硅瘽妗
銆銆绛旓細鎶婅繖鍙ヨ瘽鏀捐浇椤甸潰鐨勫紑澶
銆銆<% response.status="401 not Authorized"
銆銆response.end
銆銆%>
銆銆9.濡備綍浼犻掑彉閲忎粠涓椤靛埌鍙︿竴椤
銆銆绛旓細鐢 HIDDEN 绫诲瀷鏉ヤ紶閫掑彉閲
銆銆<% form method="post" action="mynextpage.asp" >
銆銆<% for each item in request.form %>
銆銆<input namee="< %=item% >" type="HIDDEN"
銆銆value="< %=server.HTMLEncode(Request.form(item)) % >" >
銆銆<% next %>
銆銆</form>
銆銆10.涓轰綍鎴戝湪 asp 绋嬪簭鍐呬娇鐢 msgbox锛岀▼搴忓嚭閿欒存病鏈夋潈闄
銆銆绛旓細鐢变簬 asp 鏄鏈嶅姟鍣ㄨ繍琛岀殑锛屽傛灉鍙浠ュ湪鏈嶅姟鍣ㄦ樉绀轰竴涓瀵硅瘽妗嗭紝閭d箞浣犲彧濂界瓑鏈変汉鎸変簡纭瀹氫箣鍚庯紝浣犵殑绋嬪簭鎵嶈兘缁х画鎵ц岋紝鑰屼竴鑸鏈嶅姟鍣ㄤ笉浼氭湁浜哄畧鐫锛屾墍浠ュ井杞涓嶅緱涓嶇佹㈣繖涓鍑芥暟锛屽苟鑳′贡鍛婅瘔浣
(:) 鍛靛懙) 娌℃湁鏉冮檺銆備絾鏄疉SP鍜屽㈡埛绔鑴氭湰缁撳悎鍊掑彲浠ユ樉绀轰竴涓瀵硅瘽妗嗭紝as follows:
銆銆<% yourVar="娴嬭瘯瀵硅瘽妗" %>
銆銆<script language="javascript">
銆銆alert("< %=yourvar% >")
銆銆</script>
11.鏈夋病鏈夊姙娉曚繚鎶よ嚜宸辩殑婧愪唬鐮侊紝涓嶇粰浜虹湅鍒
銆銆绛旓細鍙浠ュ幓涓嬭浇涓涓寰杞鐨刉indows s cript Encoder锛屽畠鍙浠ュ筧sp鐨勮剼鏈鍜屽㈡埛绔痡avas cript/vbs cript鑴氭湰杩涜屽姞瀵嗐
銆傘備笉杩囧㈡埛绔鍔犲瘑鍚庯紝鍙鏈塱e5鎵嶈兘鎵ц岋紝鏈嶅姟鍣ㄧ鑴氭湰鍔犲瘑鍚庯紝鍙鏈夋湇鍔″櫒涓婂畨瑁呮湁s cript engine 5锛堣呬竴涓猧e5灏辨湁浜嗭級鎵嶈兘鎵ц屻
銆銆12.鎬庢牱鎵嶈兘灏 query string 浠庝竴涓 asp 鏂囦欢浼犻佸埌鍙︿竴涓锛
銆銆绛旓細鍓嶈呮枃浠跺姞鍏ヤ笅鍙ワ細 Response.Redirect("second.asp?" & Request.ServerVariables("QUERY_STRING"))
銆銆13.global.asa鏂囦欢鎬绘槸涓嶈捣浣滅敤?
銆銆绛旓細鍙鏈墂eb鐩褰曡剧疆涓簑eb application, global.asa鎵嶆湁鏁堬紝骞朵笖涓涓獁eb application鐨勬牴鐩褰曚笅 global.asa鎵嶆湁鏁堛侷IS4鍙浠ヤ娇鐢↖nternet Service Manager璁剧疆application setting 鎬庢牱鎵嶈兘浣垮緱htm鏂囦欢濡傚悓asp鏂囦欢涓鏍峰彲浠ユ墽琛岃剼鏈浠g爜锛
銆銆14.鎬庢牱鎵嶈兘浣垮緱htm鏂囦欢濡傚悓asp鏂囦欢涓鏍峰彲浠ユ墽琛岃剼鏈浠g爜锛
銆銆绛旓細Internet Sevices Manager - > 閫夋嫨default web site - >鍙抽紶閿- >鑿滃崟灞炴-銆変富鐩褰- > 搴旂敤绋嬪簭璁剧疆锛圓pplication Setting锛- > 鐐瑰嚮鎸夐挳 "閰嶇疆"- > app mapping - >鐐瑰嚮鎸夐挳"Add" - > executable browse閫夋嫨 \WINNT\SYSTEM32\INETSRV\ASP.DLL EXTENSION 杈撳叆 htm method exclusions 杈撳叆PUT.DELETE 鍏ㄩ儴纭瀹氬嵆鍙銆
浣嗘槸鍊煎緱娉ㄦ剰鐨勬槸杩欐牱瀵筯tm涔熻佺敱asp.dll澶勭悊锛屾晥鐜囧皢闄嶄綆銆
銆銆15.濡備綍娉ㄥ唽缁勪欢
銆銆绛旓細鏈変袱绉嶆柟娉曘 銆銆绗涓绉嶆柟娉曪細鎵嬪伐娉ㄥ唽 DLL 杩欑嶆柟娉曚粠Iis 3.0涓鐩翠娇鐢ㄥ埌Iis 4.0鍜屽叾瀹冪殑Web Server銆
瀹冮渶瑕佷綘鍦ㄥ懡浠よ屾柟寮忎笅鏉ユ墽琛岋紝杩涘叆鍒板寘鍚鏈塂LL鐨勭洰褰曪紝骞惰緭鍏ワ細regsvr32 component_name.dll 渚嬪 c:\temp\regsvr32 AspEmail.dll 瀹冧細鎶奷ll鐨勭壒瀹氫俊鎭娉ㄥ唽鍏ユ湇鍔″櫒涓鐨勬敞鍐岃〃涓銆傜劧鍚庤繖涓缁勪欢灏卞彲浠ュ湪鏈嶅姟鍣ㄤ笂浣跨敤浜嗭紝浣嗘槸杩欎釜鏂规硶鏈変竴涓缂洪櫡銆傚綋浣跨敤杩欑嶆柟娉曟敞鍐屽畬姣曠粍浠跺悗锛岃ョ粍浠跺繀椤昏佺浉搴旂殑璁剧疆NT鐨勫尶鍚嶅笎鍙锋湁鏉冮檺鎵ц岃繖涓