最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ASP中查错之实例
时间:2022-06-30 11:53:44 编辑:袖梨 来源:一聚教程网
有这样一个程序,是对Application集合中的元素进行活动的添加与删除,程序如下:
<%@ LANGUAGE=VBSCRIPT %>
>
The Application Object
The ASP Application Object
<% 'look for a command sent from the FORM section buttons
If Len(Request.Form("cmdAdd")) Then ' 利用是否长度为0来判断
strVarName = Request.Form("txtVarName")
strVarValue = Request.Form("txtVarValue")
Application.Lock
Application(strVarName) = strVarValue ' 此处报错
Application.Unlock
End If
If Len(Request.Form("cmdRemoveThis")) Then
strToRemove = Request.Form("lstRemove")
Application.Lock
Application.Contents.Remove(strToRemove)
Application.Unlock
End If
If Len(Request.Form("cmdRemoveAll")) Then
Application.Lock
Application.Contents.RemoveAll
Application.Unlock
End If
%>
<%
For Each objItem in Application.Contents
If IsObject(Application.Contents(objItem)) Then
Response.Write "Object reference: '" & objItem & "'
"
ElseIf IsArray(Application.Contents(objItem)) Then
Response.Write "Array: '" & objItem & "' contents are:
"
varArray = Application.Contents(objItem)
<%@ LANGUAGE=VBSCRIPT %>
>
The ASP Application Object
<% 'look for a command sent from the FORM section buttons
If Len(Request.Form("cmdAdd")) Then ' 利用是否长度为0来判断
strVarName = Request.Form("txtVarName")
strVarValue = Request.Form("txtVarValue")
Application.Lock
Application(strVarName) = strVarValue ' 此处报错
Application.Unlock
End If
If Len(Request.Form("cmdRemoveThis")) Then
strToRemove = Request.Form("lstRemove")
Application.Lock
Application.Contents.Remove(strToRemove)
Application.Unlock
End If
If Len(Request.Form("cmdRemoveAll")) Then
Application.Lock
Application.Contents.RemoveAll
Application.Unlock
End If
%>
The Application.Contents Collection
<%
For Each objItem in Application.Contents
If IsObject(Application.Contents(objItem)) Then
Response.Write "Object reference: '" & objItem & "'
"
ElseIf IsArray(Application.Contents(objItem)) Then
Response.Write "Array: '" & objItem & "' contents are:
"
varArray = Application.Contents(objItem)
相关文章
- 无期迷途主线前瞻直播总结 无期迷途主线前瞻直播内容介绍 11-22
- 以下哪种非遗技艺是用针在纸上绣画 蚂蚁新村11月21日答案 11-22
- 江南百景图听风塔怎么样 11-22
- 原神恰斯卡圣遗物怎么搭配 11-22
- 2024年霸王茶姬11月22日口令是什么 2024.11.22霸王茶姬口令介绍 11-22
- 光遇11.21季节蜡烛在哪里 光遇11月21日季节蜡烛位置攻略 11-22