ASPÄÚÖöÔÏó¼°Æä×÷ÓÃ
Ò»¡¢Application¶ÔÏó
Application¶ÔÏóÊǸöÓ¦ÓóÌÐò¼¶µÄ¶ÔÏó£¬ÓÃÀ´ÔÚËùÓÐÓû§¼ä¹²ÏíÐÅÏ¢£¬²¢¿ÉÒÔÔÚWebÓ¦ÓóÌÐòÔËÐÐÆÚ¼ä³Ö¾ÃµØ±£³ÖÊý¾Ý¡£
ApplicationµÄÊôÐÔ£º
Application¶ÔÏóûÓÐÄÚÖõÄÊôÐÔ£¬µ«ÊÇÎÒÃÇ¿ÉÒÔ×ÔÐд´½¨ÆäÊôÐÔ¡£
<% Application(”ÊôÐÔÃû”)=Öµ %>
´ó²¿·ÖApplication±äÁ¿¶¼¡¡´æ·ÅÔÚContents¼¯ºÏÖУ¬µ±´´½¨Ò»¸öеÄApplication±äÁ¿Ê±£¬Æäʵ¾ÍÊÇÔÚContents¼¯ºÏÖÐÌí¼ÓÁËÒ»Ïî¡£ÏÂÃæÁ½¸ö½Å±¾ÊǵÈЧµÄ£º
<% Application(”greeting”)=”hello!” %> »ò <% Application.contents(”greeting”)=”hello!”ÓÉÓÚApplication±äÁ¿´æÔÚ¼¯ºÏÀËùÒÔ
Èç¹ûÏëҪȫ²¿ÏÔʾ, ¿ÉÒÔʹÓÃFor EachÑ»·¡£
<%
For Each item IN Application.Contents
Response.write(”<br>”&item&Application.Contents(item))
next
%>
ApplicationµÄ·½·¨£º
ApplicationµÄ·½·¨Ö»ÓÐÁ½¸ö·½·¨£ºÒ»¸öÊÇLock£¬ÁíÒ»¸öÊÇUnlock¡£ÆäÖÐLock·½·¨ÓÃÓÚ±£Ö¤Í¬Ò»Ê±¿ÌÖ»ÄÜÒ»¸öÓû§¶ÔApplication²Ù×÷¡£
UnlockÔòÓÃÓÚÈ¡ÏûLock·½·¨µÄÏÞÖÆ¡£È磺
<%
Application.Lock
Application(”visitor_num”)=Application(”visitor_num”)+1
Application.Unlock
%>
ApplicationµÄʼþ£º
1¡¢Application_OnStart()
µ±Ê¼þÓ¦ÓóÌÐòÆô¶¯Ê±´¥·¢¡£
2¡¢Application_OnEnd()
´ËʼþÓ¦ÓóÌÐò½áÊøʱ´¥·¢¡£
ÕâÁ½¸öʼþ¹ý³Ì¶¼ÊDZØÐ붨ÒåÔÚGlobal.aspÎļþÖУ¬Ò»°ã°ÑÁ¬½ÓÊý¾ÝµÄº¯Êý¶¨ÒåÔÚÕâÁ½¸öʼþ£¬È»ºó·ÅÔÚGlobal.aspÖС£ÀýÈ磺
Sub Application_OnStart
Application(”tt18_ConnectionString”) = “driver={SQL
Server};server=jeff;uid=sa;pwd=;database=test”
End Sub
Ò»¸öÊý×éÄܹ»±»¶¨Òå³ÉApplication¶ÔÏ󣬲»¹ýÕâ¸öÊý×éÖ»ÄÜ×÷Ϊһ¸ö¶ÔÏ󱣴棬¶ø²»ÄÜÓÃApplication(0)È¡³öÆäÖµ¡£¿ÉÒÔ¶¨ÒåÒ»¸öÁÙʱÊý
×éʵÏÖÕâÖÖ¹¦ÄÜ¡£È磺
<%
dim Array()
Array=Application(”array”)
for i = 0 to ubound(array)
Response.write Array(i)
next i
%>
ͬÑùÒªÐÞ¸ÄÕâ¸öApplication¶ÔÏóÒ²¿ÉÒÔ¶¨ÒåÒ»¸öÁÙʱÊý×飬°ÑApplication¶ÔÏ󸳸øÊý×飬ȻºóÐÞ¸ÄÕâ¸öÊý×éµÄÔªËØ£¬×îºó°ÑÊý×鸳»Ø
Application¶ÔÏó¡£È磺
<%
dim Array()
Array=Application(”array”)
Arr
Ïà¹ØÎĵµ£º
Èç¹ûÓû§Ê¹ÓõÄä¯ÀÀÆ÷Ö§³Ö¶¯Ì¬ HTML (DHTML)£¬Ôò ASP.NET ÑéÖ¤¿Ø¼þ¿ÉÒÔʹÓÿͻ§¶Ë½Å±¾À´Ö´ÐÐÑéÖ¤¡£ÒòΪÕâÖֿؼþ¿ÉÒÔÌṩ¼°Ê±·´À¡£¨ÎÞÐèµ½·þÎñÆ÷µÄÍù·µ¹ý³Ì£©£¬ËùÒÔÓû§»á¸Ð¾õµ½Ò³µÄÐÔÄÜÓÐËù¸ÄÉÆ¡£
ÔÚ´ó¶àÊýÇé¿öÏ£¬ÎÞÐè¶ÔÒ³»òÑéÖ¤¿Ø¼þ×÷³öÈκθü¸Ä±ã¿ÉʹÓÿͻ§¶ËÑéÖ¤¡£¿Ø¼þ½«×Ô¶¯¼ì²âä¯À ......
¡¡¡¡ÔÚ±àдASP³ÌÐòµÄʱºò£¬Í¨³£¶¼»áÓõ½<!--#include virtual|file="path/filename"-->°ÑÒ»¶ÎÏà¶Ô¶ÀÁ¢µÄÎļþ´úÂëǶÌ×µ½µ±Ç°Ò³ÃæÖÐÀ´¡£ÔÚʵ¼ÊµÄʹÓÃÖкܶàÈ˶Ô"file"ºÍ"virtual"µÄʹÓò»Ì«Àí½â£¬µ¼ÖÂÒ³ÃæÖ´ÐеÄʱºò»á³öÏÖ´íÎó¡£Ï־͸ÃÎÊÌâ×÷Ò»¸ö¼òÊö¡£
¡¡¡¡Ê¹ÓÃ"file"µÄʱºò£¬µÈºÅºóÃæʹÓõÄÊÇÏà¶Ô·¾¶¡£ËùνÏච......
dataurl=Server.MapPath("menutree.mdb")'Êý¾Ý¿âµØÖ·
dim conn,strQuery,rs
set conn = server.CreateObject("adodb.connection")
conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&dataurl
strQuery="select * from menufun"
set rs=server.createobject("adodb.recordset")
rs.open strQuery,conn,1 ......
¡¡¡¡ÕâÊÇÒ»¸ö¾³£±»Ìá³öµÄÎÊÌ⣬²¢ÇÒËüºÜÈÝÒ×°ÑÈËÃÇ´øÈëÕùÂÛLinux»¹ÊÇWindowsµÄÆç;¡£ÕâÑùµÄÕùÂÛÊÂʵÉÏ·´Ó³³öÁ˶ÔÓÚÏ໥¾ºÕùµÄWeb¿ª·¢¼¼ÊõÒª½øÐв¢ÐзÖÎöÊǶàôÀ§ÄѵÄÒ»¼þÊÂÇ飬¶øÕâÒ»ÄѶÈͬʱÒòΪ¿ª·¢ÈËÔ±¶ÔÈκοɱȽϲÙ×÷ϵͳµÄ²»Í¬Òâ¼û¶ø´ó´óÔö¼Ó¡£
¡¡¡¡ËùÒÔÓëÆä¼ÌÐø²ÎÓëµ½ÕâÑùµÄÕùÂÛÖУ¬ÎÒÃÇ»¹²»ÈçÀ´¿´¿´Ã¿Ò»Ïî¼¼Êõ¶Ô ......
1. ÏÖÔÚµÄÈÕÆÚʱ¼äÃüÁîÊÇ <%=now%> ¼´¿É
2.ASPÈ¡µÃ±í¸ñ(from)Êý¾ÝÊäÈëµÄ·½·¨£¬ÊÇʹÓÃÒ»¸öÄÚÖõĶÔÏó(object)—Requect, ËüÒÔget,post¶øÒì¡£
3.ÈôÒª×Ô¼ºÓÃVB»òÆäËüÓïÑÔ±àд£¬.dllÎļþ¹©ASPʹÓÃÐ轫DLLÎļþ×¢²á·½¿É£ºDOSÏÂÊäÈë regsbr32 *.dll
4.ÏÔʾÎå¸öÖظ´µÄ¾ä×Ó£¬×ÖÌåÔ½À´Ô½´ó <% for i=1 to 5 %> &l ......