调试输出错误方法什么的。
If Err.Number <> 0 then call Err_Handler() End If Sub Err_Handler() Response.write "<div style='color:red'>程式發生錯誤<br />" Response.write "錯誤源碼 : " & Err.Source & "<br />" Response.write "錯誤代號 : " & Err.Number & "<br />" Response.write "錯誤訊息 : " & Err.Description & "</div>" Response.End End Sub Function IIf( exp, rst1, rst2) If exp Then IIf = rst1 Else IIf = rst2 End Function
傳回 post 或 get 方法所收到的所有參數
Dim obj for each obj in Request.Form response.write obj & "=" & Request.Form(obj) & "<br />" next Dim obj for each obj in Request.QuerString response.write obj & "=" & Request.QuerString(obj) & "<br />" next
太長的敘述要以 &_ 斷行
response.write "this is a" &_ "asp program test."
此範例為計算上線人數
Sub Application_OnStart Application("OnlineCount") = 0 End Sub Sub Application_OnEnd End Sub Sub Session_OnStart Application.Lock Application("OnlineCount") = Application("OnlineCount") + 1 Application.UnLock End Sub Sub Session_OnEnd Application.Lock Application("OnlineCount") = Application("OnlineCount") - 1 Application.UnLock End Sub
吉公网安备 22020202000301号