CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

ASP.NET Form Variables to String from the current Request

265 Views
Copy Code Show/Hide Line Numbers
/// <summary>
/// Returns the content of the POST buffer as string
/// </summary>
/// <returns></returns>
public static string FormBufferToString()
{
    HttpRequest Request = HttpContext.Current.Request;            
 
    if (Request.TotalBytes > 0)            
        return Encoding.Default.GetString(Request.BinaryRead(Request.TotalBytes));
 
    return string.Empty;
}
by Rick Strahl
  August 19, 2010 @ 2:39pm
Tags:

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate