asp-classic - 请求与 Request.QueryString

标签 asp-classic vbscript

这两者在VBScript中有什么区别:

Request("startDate")

Request.QueryString["startDate"]

在哪里Request("startDate")记录在案?我在这里没有看到这种用法:

http://www.w3schools.com/asp/asp_ref_request.asp

最佳答案

Request 的官方文档ASP 经典中的对象在这里:http://msdn.microsoft.com/en-us/library/ms524948%28VS.90%29.aspx

引用这个问题的相关部分:

All variables can be accessed directly by calling Request(variable) without the collection name. In this case, the Web server searches the collections in the following order:

  • QueryString
  • Form
  • Cookies
  • ClientCertificate
  • ServerVariables

If a variable with the same name exists in more than one collection, the Request object returns the first instance that the object encounters.



编辑:AnthonyWJones 对这个问题发表了很好的评论:避免使用 Request("name")语法。实际上,上面的文档链接中提到了这一点:

It is strongly recommended that when referring to members of a collection the full name be used. For example, rather than Request.("AUTH_USER") use Request.ServerVariables("AUTH_USER"). This allows the server to locate the item more quickly.

关于asp-classic - 请求与 Request.QueryString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9196476/

相关文章:

mysql - SQL注入(inject)预防

javascript - 隐藏输入字段的数组

windows - 批处理文件调用 VBS,它向应用程序发送 key

c# - 我需要创建一个基于 C# 的 COM 服务器以便在 VBScript 中使用

html - 将文本换行到页面内的特定宽度

asp-classic - 使用 VBScript(经典 ASP)列出 JScript 对象中的键

asp-classic - 无效的过程调用或参数 : 'Mid'

使用 vbscript 检查 Windows 更新

excel - 从 Windows Scripting Host 操作 Excel 文件

vba - Excel VBA - 宏错误 - 宏可能不可用 - 自动刷新