Save the Contents of the ASP.NET Request Object to a File

Category:
C#, VB.NET, ASP.NET
Type:
Snippets
Difficulty:
Beginning
Author:
Intelligent Solutions Inc.

Version Compatibility: ASP.NET

More information:
In ASP.NET, the new save as method allows you to save the contents of the object to a file. This is useful for debugging. The first parameter of this method is the full path of the file to save to, the second is a boolean set to true if you want to save the http headers.

This is a simple function that wraps request.saveas along with a demo of how to use it.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: