扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:佚名 来源:CODEOF 2007年10月16日
关键字: asp application 集合
在本页阅读全文(共19页)
<!-- Declare instance of the ASPCounter component with application-level scope //--> <OBJECT ID=”ASPCounter” RUNAT=”Server” SCOPE=”Applicatoin” PROGID=”MSWC.Counters”> </OBJECT> ... ... <SCRIPT LANGUAGE=”VBScript” RUNAT=”Server”> Sub Application_onStart() ‘Create an instance of an ADO Connection with application-level scope Set Application(“ADOConnection”) = Server.CreateObject(“ADODB.Connection”) Dim varArray(3) ‘Create a Variant array and fill it varArray(0) = “This is a” varArray(1) = “Variant array” varArray(2) = “stored in the” varArray(3) = “Application object” Application(“Variant_Array”) = varArray ‘Store it in thd Application Application(“Start_Time”) = CStr(Now) ‘Store the date/time as a string Application(“Visit_Count”) = 0 ‘Set counter variable to zero End Sub ... ... </SCRIPT> |
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) ‘Note: the following only works with a one-dimensional array For intLoop = 0 To UBound(varArray) Response.Write “ Index(“ & intLoop & “) = “ & _ VarArray(intLoop) & “ ” Next Else Response.Write “Variable: ‘” & objItem & “’ = “ _ & Application.Contents(objItem) & “ ” End If Next |
varArray = Application.Contents(objItem) |
For intLoop = 0 UBound(varArray) |
For intLoop = 0 To UBound(varArray) IntNumberOfDimensions = UBound(varArray, 1) For intDimension = 0 To intNumberOfDimensions Response.Write “ Index(“ & intLoop & “) = “ _ & varArray(intLoop, intDimension) Next Response.Write “” Next |
For Each objItem in Application.StaticObjects If IsObject(Application.StaticObjects(objItem)) Then Response.Write “<OBJECT> element: ID=’” & objItem & “’ ” End If Next |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者