ASPÖÐÊ®´ó³£ÓóÌÐò´úÂë.£ºµÚËĽڡ´ÎÒµÄÐĵáµ
ÓÃASPÉè¼ÆÍøÕ¾ÔÚÏßÈËÊýͳ¼Æ³ÌÐò
¡¡¡¡ÔÚä¯ÀÀÍøÒ³µÄʱºî£¬³£³£¿ÉÒÔ¿´¼ûһЩ“µ±Ç°ÍøÕ¾ÉϵÄÈËÊýÊǣأأØÈË”µÄÔÚÏßÈËÊýͬ¼Æ¡£ÈçºÎÓÃASPÀ´×öÒ»¸öÄØ£¿Ê×ÏÈ£¬·ÖÎöÒ»ÏÂËüµÄ×ö·¨£¬Ò»°ãÀ´Ëµ£¬ÕâЩÏßÉÏÈËÊýͳ¼Æ¶¼ÊÇÖ¸Ò»¸öʱ¶ÎÄڵķÿÍÈËÊýͳ¼Æ¡£±ÈÈ磨5·ÖÖÓÄÚ£¬10·ÖÖÓÄÚ£©¶øÕâ¸öʱ¼äµÄ³¤¶Ì£¬ÊÇÓÉÉè¼ÆÕßÉ趨µÄ¡£
¡¡¡¡ÔÚÕâ¸öʱ¶ÎÄÚͬ¼Æ¸÷¸ö²»Í¬£É£ÐµÄ·Ã¿Í×ÜÊý£¬¾Í¿ÉÒԵóöµ±Ç°µÄÏßÉÏÈËÊýÁË£¬µ«ÕâÀïÓÐÒ»¸ö¾«È·ÎÊÌâÐèÒª½â¾ö£¬ÖÁÓÚÓÃʲô°ì·¨À´¾«È·µØͳ¼Æ£¬ÄǾÍÊǸ÷È˲»Í¬µÄ×ö·¨ÁË£¬±ÈÈç¿ÉÒÔÓÃ×Ô¶¯Ìá½»µÄÒ³Ã棬¸ôÒ»¶Îʱ¼ä¶ÁÈ¡COOKIESµÈµÈ£¬¶øÔÚASPÖУ¬ÓÐÒ»¸ö¸üºÃµÄ¼¼ÇÉ£¬¾ÍÊÇʹÓÃsession¶ÔÏóÀ´Í³¼Æ£¬ÕâÀï½éÉÜÒ»ÏÂgobal.asaÕâ¸öÎļþ£¬ÕâÊÇÒ»¸öºÜÖØÒªµÄÒ»¸öÎļþ£¬Çë¿´¿´ËüµÄ½á¹¹¡£
£¼SCRIPT LANGUAGE="VBScript" RUNAT="Server"£¾
Sub Session_OnStart
End Sub
Sub Session_OnEnd
End Sub
sub Application_OnStard
End Sub
sub Application_OnEnd
End Sub£¼/SCRIPT£¾
¡¡¡¡µ±ÓÐÒ»¸ö»á»°·¢Éúʱ£¨Óû§ä¯ÀÀÍøÒ³£¬ÏòWeb·þÎñÆ÷·¢³öÇëÇó£©ÄÇô£¬Èç¹û×Ô·þÎñÆ÷Æô¶¯ºóµÚÒ»¸öÓû§µÄ»°£¬¾Í»áͬʱ·¢ÉúApplication_OnStardºÍSession_OnStartÕâÁ½¸öʼþ£¬Ö®ºó£¬ÔÙÓбðµÄÓû§·¢³öÇëÇóµÄ»°£¬¾ÍÖ»·¢ÉúSession_OnStartÕâ¸öʼþ£¬¶øsessionµÄÉú´æÆÚÊǶ೤£¬ÊÇ¿ÉÒÔÉ趨µÄ£¬Session.timeout=X£¨·ÖÖÓ£©
¡¡¡¡ºÃÁË£¬ÓÐÁËÕâ¸öºÜºÃÓõķ½·¨£¬ÎÒÃǾÍÄÜ׼ȷµØͳ¼Æ³öÔÚÏßÈËÊýÁË£¬¶øÈËÊý×ܼÆÊÇÓÃÒ»¸öapplication±äÁ¿À´±£´æ£¬µ±ÔÚµÚÒ»¸ö»á»°¿ªÊ¼Ê±£¬ÔÚApplication_OnStardʼþÖзÅÖÃÒ»ÌõÇå¿Õ¼ÆÊýÆ÷µÄÓï¾äapplication("online")=0£¬È»ºó£¬ÔÚSession_OnStartʼþÖУ¬·ÅÖÃÒ»ÌõÔö¼ÓÔÚÏßÈËÊýµÄÓï¾äapplication("online")=application("online")+1£¬¶øÔÚSession_OnEndʼþÏàÓ¦µØ·ÅÒ»Ìõ¼õÉÙÔÚÏßÈËÊýµÄÓï¾ä£¬Áî¼ÆÊýÖµ¼õÒ»¡£
¡¡¡¡ÕâÑù£¬Õâ¸öÎļþ¾Í¸ÄΪÈçÏÂ
£¼SCRIPT LANGUAGE="VBScript" RUNAT="Server"£¾
Sub Session_OnStart
application("online")=application("online")+1
End Sub
Sub Session_OnEnd
application("online")=application("online")-1
End Sub
sub Application_OnStard
application("online")=0
End Sub
sub Application_OnEnd
application("online")=0
End Sub£¼/SCRIPT£¾
¡¡¡¡½ÓÏÂÀ´±àÒ»¸öÏÔʾͼÐÎÊý×ֵijÌÐò£¬°ÑÔÚÏßÈËÊýÏÔʾÔÚÖ¸¶¨µÄÒ³ÃæÉÏ¡£ÕâÑù¾ÍÄܵóöÔÚÈËÊýÁË
*online.asp
£¼% @language="vbscript" %£¾
£¼%
tmp=application(
Ïà¹ØÎĵµ£º
»ú¹¹Ãû³Æ£º ÈÕÆÚ£º2009 - 09 - 14 ²é¿´´ÎÊý£º
334 ´Î
ASP.NetºÍASPµÄ×î´óÇø±ðÔÚÓÚ±à³Ì˼άµÄת»»£¬¶ø²»½ö½öÔÚÓÚ¹¦ÄܵÄÔöÇ¿¡£ASPʹÓÃVBS/JSÕâÑùµÄ½Å±¾ÓïÑÔ»ìºÏhtmlÀ´±à³Ì£¬¶øÄÇЩ½Å±¾ÓïÑÔÊôÓÚÈõÀàÐÍ¡¢ÃæÏò½á¹¹µÄ±à³ÌÓïÑÔ£¬¶ø·ÇÃæÏò¶ÔÏó£¬Õâ¾ÍÃ÷Ï ......
Try
Dim Path As String = Server.MapPath("~/Download/") 'Îļþ·¾¶
Path = Path & "file.txt" 'ÎļþµÄÃû³Æ
......
<%
If Not IsNull(Request("fileName")) Then r = DownLoadFile(Request("fileName"))
Function DownLoadFile(fileName)
Dim s,fso,f,fLen
fileName = Server.MapPath(fileName)
'create stream
Set s = Server.CreateObject("ADODB.Stream")
s.Open()
s.Type = 1
Set fso = Server.CreateObject ......
µÚÒ»½Ú:×¢²áϵͳ
×¢²á¼¸ºõÊÇÿ¸öÍøÕ¾¶¼ÒªÊ¹Óõģ¬È¥ÂÛ̳Ҫע²á£¬ÁÄÌìҪע²á£¬¼¸ºõÎÞ´¦²»×¢²á£¬ËùÒÔ×¢²áÊÇËùÓÐASPÓ¦ÓóÌÐòÖÐ×î³£¼ûµÄ¡£
& ......