鏄浠涔坃鏂囨。涓嬭浇

2013 年 3 月 8 日1,2680

ASP 鏄浠涔堬紵

ASP 鎸 Active Server Pages 锛堝姩鎬佹湇鍔″櫒椤甸潰锛, 鏄涓椤瑰井杞鍏鍙哥殑鎶鏈,鍦 IIS 涓杩愯岀殑绋嬪簭.

IIS 鎸 Internet Information Services 锛圛nternet 淇℃伅鏈嶅姟锛

IIS 鏄 Windows 2000 鍙 Windows 2003 鐨勫厤璐圭粍浠

IIS 鍚屾椂涔熸槸 Windows NT 4.0 鐨勫彲閫夌粍浠

姝ゅ彲閫夌粍浠跺彲閫氳繃鍥犵壒缃戜笅杞

PWS 鐨勪綋绉鏇村皬 - 涓嶈繃鎷ユ湁 IIS 鐨勫畬鏁村姛鑳

PWS 鍙鍦 Windows 95/98 鐨勫畨瑁 CD 涓鎵惧埌

ASP 鏂囦欢鏄浠涔堬紵

ASP 鏂囦欢鍜 HTML 鏂囦欢绫讳技

ASP 鏂囦欢鍙鍖呭惈鏂囨湰銆丠TML銆乆ML 鍜岃剼鏈

ASP 鏂囦欢涓鐨勮剼鏈鍙鍦ㄦ湇鍔″櫒涓婃墽琛屻

ASP 鏂囦欢鐨勬墿灞曞悕鏄 ".asp"

ASP 鍜 HTML 鏈変綍涓嶅悓锛

褰撴祻瑙堝櫒璇锋眰鏌愪釜 HTML 鏂囦欢鏃讹紝鏈嶅姟鍣ㄤ細杩斿洖杩欎釜鏂囦欢

鑰屽綋娴忚堝櫒璇锋眰鏌愪釜 ASP 鏂囦欢鏃讹紝IIS 灏嗚繖涓璇锋眰浼犻掕嚦 ASP 寮曟搸銆侫SP 寮曟搸浼氶愯屽湴璇诲彇杩欎釜鏂囦欢锛屽苟鎵ц屾枃浠朵腑鐨勮剼鏈銆

鏈鍚庯紝ASP 鏂囦欢灏嗕互绾 HTML 鐨勫舰寮忚繑鍥炲埌娴忚堝櫒銆

ASP 鑳戒负浣犲仛浠涔堬紵

1)鍔ㄦ佸湴缂栬緫銆佹敼鍙樻垨鑰呮坊鍔犻〉闈㈢殑浠讳綍鍐呭

2)瀵圭敱鐢ㄦ埛浠 HTML 琛ㄥ崟鎻愪氦鐨勬煡璇㈡垨鑰呮暟鎹浣滃嚭鍝嶅簲

3)璁块棶鏁版嵁鎴栬呮暟鎹搴擄紝骞跺悜娴忚堝櫒杩斿洖缁撴灉

4)涓轰笉鍚岀殑鐢ㄦ埛瀹氬埗缃戦〉锛屾彁楂樿繖浜涢〉闈㈢殑鍙鐢ㄦ

鍩烘湰鐨 ASP 璇娉曡勫垯

閫氬父鎯呭喌涓嬶紝ASP 鏂囦欢鍖呭惈 HTML 鏍囩撅紝绫讳技 HTML 鏂囦欢銆備笉杩囷紝ASP 鏂囦欢涔熻兘澶熷寘鍚鏈嶅姟鍣ㄧ鑴氭湰锛岃繖浜涜剼鏈琚鍒嗛殧绗 <% 鍜 %> 鍖呭洿璧锋潵銆

鏈嶅姟鍣ㄨ剼鏈鍦ㄦ湇鍔″櫒涓婃墽琛岋紝鍙鍖呭惈鍚堟硶鐨勮〃杈惧紡銆佽鍙ャ佹垨鑰呰繍绠楃︺

鍚戞祻瑙堝櫒鍐欒緭鍑

response.write 鍛戒护鐢ㄦ潵鍚戞祻瑙堝櫒鍐欒緭鍑恒備笅闈㈢殑渚嬪瓙鍚戞祻瑙堝櫒浼犻佷簡涓娈垫枃鏈锛"Hello World"銆

<html>

<body>

<%

response.write("Hello World!")

%>

</body>

</html>

杩樻湁涓绉 response.write 鍛戒护鐨勭畝鍐欐柟娉曘備笅闈㈢殑渚嬪瓙鍜屼笂闈㈢殑渚嬪瓙鏄绛夋晥鐨勶細

<html>

<body>

<%="Hello World!"%>

</body>

</html>

鍦 ASP 涓浣跨敤 VBScript

浣犲彲浠ュ湪 ASP 涓浣跨敤鑻ュ共绉嶈剼鏈璇瑷銆備笉杩囷紝榛樿ょ殑鑴氭湰璇瑷鏄 VBScript锛

鍦 ASP 涓浣跨敤 JavaScript

濡傛灉闇瑕佷娇鐢 JavaScript 浣滀负鏌愪釜鐗瑰畾椤甸潰鐨勯粯璁よ剼鏈璇瑷锛屽氨蹇呴』鍦ㄩ〉闈㈢殑椤剁鎻掑叆涓琛岃瑷璁惧畾锛

<%@ language="javascript"%>

<html>

<body>

<%

Response.Write("Hello World!")

%>

</body>

</html>

娉ㄦ剰锛氫笌 VBScript 涓嶅悓 - JavaScript 瀵瑰ぇ灏忓啓鏁忔劅銆

鎵浠ヤ綘闇瑕佹牴鎹 JavaScript 鐨勯渶瑕佷娇鐢ㄤ笉鍚岀殑澶у皬鍐欏瓧姣嶇紪鍐 ASP 浠g爜銆

ASP 涓 VBScript 鍜 JScript 鐨勯厤鍚堟槸鍘熺敓鎬х殑锛圝Script 鏄寰杞鐨 JavaScript 瀹炵幇锛夈傚傛灉浣犻渶瑕佷娇鐢ㄥ叾浠栬瑷缂栧啓鑴氭湰锛屾瘮濡 PERL銆丷EXX 鎴栬 Python锛岄偅灏卞繀椤诲畨瑁呯浉搴旂殑鑴氭湰寮曟搸銆

鍙橀噺鐨勭敓瀛樻湡

鍦ㄥ瓙绋嬪簭澶栧0鏄庣殑鍙橀噺鍙琚 ASP 鏂囦欢涓鐨勪换浣曡剼鏈璁块棶鍜屼慨鏀广

鍦ㄥ瓙绋嬪簭涓澹版槑鐨勫彉閲忓彧鏈夊綋瀛愮▼搴忔瘡娆℃墽琛屾椂鎵嶄細琚鍒涘缓鍜屾挙閿銆傚瓙绋嬪簭澶栫殑鑴氭湰鏃犳硶璁块棶鍜屼慨鏀硅ュ彉閲忋

濡傞渶澹版槑渚涘氫釜 ASP 鏂囦欢浣跨敤鐨勫彉閲忥紝璇峰皢鍙橀噺澹版槑涓 session 鍙橀噺鎴栬 application 鍙橀噺銆

Session 鍙橀噺

Session 鍙橀噺鐢ㄤ簬瀛樺偍鍗曚竴鐢ㄦ埛鐨勪俊鎭锛屽苟涓斿逛竴涓搴旂敤绋嬪簭涓鐨勬墍鏈夐〉闈㈠潎鏈夋晥銆傚瓨鍌ㄤ簬 session 涓鐨勫吀鍨嬫暟鎹鏄濮撳悕銆乮d 鎴栧弬鏁般

Application 鍙橀噺

Application 鍙橀噺鍚屾牱瀵逛竴涓搴旂敤绋嬪簭涓鐨勬墍鏈夐〉闈㈠潎鏈夋晥銆侫pplication 鍙橀噺鐢ㄤ簬瀛樺偍涓涓鐗瑰畾鐨勫簲鐢ㄧ▼搴忎腑鎵鏈夌敤鎴风殑淇℃伅銆

瀛愮▼搴

ASP 婧愪唬鐮佸彲鍖呭惈瀛愮▼搴忓拰鍑芥暟锛

<html>

<head>

<%

sub vbproc(num1,num2)

response.write(num1*num2)

end sub

%>

</head>

<body>

<p>Result: <%call vbproc(3,4)%></p>

</body>

</html>

灏 <%@ language="language" %> 杩欎竴琛屽啓鍒 <html> 鏍囩剧殑涓婇潰锛屽氨鍙浠ヤ娇鐢ㄥ彟澶栦竴绉嶈剼鏈璇瑷鏉ョ紪鍐欏瓙绋嬪簭鎴栬呭嚱鏁帮細

<%@ language="javascript" %>

<html>

<head>

<%

function jsproc(num1,num2)

{

Response.Write(num1*num2)

}

%>

</head>

<body>

<p>Result: <%jsproc(3,4)%></p>

</body>

</html>

VBScript 涓 JavaScript 涔嬮棿鐨勫樊寮

褰撲粠涓涓鐢 VBScript 缂栧啓鐨 ASP 鏂囦欢涓璋冪敤 VBScript 鎴栬 JavaScript 瀛愮▼搴忔椂锛屽彲浠ヤ娇鐢ㄥ叧閿璇 "call"锛屽悗闈㈣窡鐫瀛愮▼搴忓悕绉般

鍋囧傚瓙绋嬪簭闇瑕佸弬鏁帮紝褰撲娇鐢ㄥ叧閿璇 "call" 鏃跺繀椤讳娇鐢ㄦ嫭鍙峰寘鍥村弬鏁般傚亣濡傜渷鐣 "call"锛屽弬鏁板垯涓嶅繀鐢辨嫭鍙峰寘鍥淬傚亣濡傚瓙绋嬪簭娌℃湁鍙傛暟锛岄偅涔堟嫭鍙峰垯鏄鍙閫夐」銆

褰撲粠涓涓鐢 JavaScript 缂栧啓鐨 ASP 鏂囦欢涓璋冪敤 VBScript 鎴栬 JavaScript 瀛愮▼搴忔椂锛屽繀椤诲湪瀛愮▼搴忓悕鍚庝娇鐢ㄦ嫭鍙枫

0 0