ASP - Printing the entire request contents

百般思念 提交于 2019-12-07 00:48:23

问题


I'm debugging some ASP code and I need to get a quick printout of the current Request datastructure, which I believe is an array of key/value pairs.

I see that Request.Form("key") is the method for extracting individual elements.

Any tips on printing out the entire thing?


回答1:


Try this

For Each item In Request.Form
    Response.Write "Key: " & item & " - Value: " & Request.Form(item) & "<BR />"
Next



回答2:


Try a FOR/EACH loop:

for each x in Request.Form
    Response.Write(x)
Next



回答3:


Working:

For x = 1 to Request.Form.Count Response.Write x & ": " _ & Request.Form.Key(x) & "=" & Request.Form.Item(x) & "<BR>" Next

I have other Classic ASP code snippets here:

https://github.com/RaviRamDhali/programming-procedure/tree/master/Snippets/ASP



来源:https://stackoverflow.com/questions/2089048/asp-printing-the-entire-request-contents

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!