开发者

ASP - Printing the entire request contents

开发者 https://www.devze.com 2022-12-17 21:13 出处:网络
I开发者_如何学Go\'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开发者_如何学Go'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?


Try this

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


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


Try a FOR/EACH loop:

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

精彩评论

暂无评论...
验证码 换一张
取 消