Filtering the HTTP Request body using InputStream : Request « Page Lifecycle « ASP.NET Tutorial

ASP.NET Tutorial
1. ASP.Net Instroduction
2. Language Basics
3. ASP.net Controls
4. HTML Controls
5. Page Lifecycle
6. Response
7. Collections
8. Validation
9. Development
10. File Directory
11. Sessions
12. Cookie
13. Cache
14. Custom Controls
15. Profile
16. Configuration
17. LINQ
18. ADO.net Database
19. Data Binding
20. Ajax
21. Authentication Authorization
22. I18N
23. Mobile
24. WebPart
25. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
ASP.NET Tutorial » Page Lifecycle » Request 
5. 8. 7. Filtering the HTTP Request body using InputStream
<html>
   <head>
      <title>Submit a named parameter via POST</title>
   </head>
<body>

   <form id="form1" action="NextPage.aspx" method="POST">
      <h3>Name:</h3>
      <input type="text" name="name">
      <input type="submit">
   </form>

</body>
</html>

File: NextPage.aspx
<%@ Page Language="vb" %>
<%@ import namespace = "System.IO" %>
<html>
   <head>
      <title>Filtering the HTTP Request body using InputStream</title>
   </head>
<body>



<%
Dim intvar As Integer
intvar = Request.TotalBytes
Response.Write("The size of the current request body is: <br>")
Response.Write(intvar & " bytes.<br>")

Dim InStream As Stream
Dim iCounter, StreamLength, iRead As Integer
Dim OutString As String
Dim Found As Boolean

InStream = Request.InputStream
StreamLength = CInt(InStream.Length)
Dim ByteArray(StreamLengthAs Byte
Trace.Write("StreamLength", StreamLength)
iRead = InStream.Read(ByteArray, 0, StreamLength)

For iCounter = to StreamLength - 1
   If Found = True Then
      OutString = OutString & Chr(ByteArray(iCounter))
   End If
   If Chr(ByteArray(iCounter)) "A" Then
      Trace.Write("Found""Found an 'A'")
      Found = True
      OutString = OutString & Chr(ByteArray(iCounter))
   End If
   Trace.Write("Loop Number", iCounter)
   Trace.Write("CurrentChar", Chr(ByteArray(iCounter)))
Next iCounter

Response.Write("Output: " & OutString)
%>


</body>
</html>
5. 8. Request
5. 8. 1. Get Request.UserLanguages
5. 8. 2. Request.UrlReferrer
5. 8. 3. Request.QueryString
5. 8. 4. Request.Cookies
5. 8. 5. Get browser information
5. 8. 6. Request.ServerVariables
5. 8. 7. Filtering the HTTP Request body using InputStream
5. 8. 8. Showing Parameters via the Params Collection in ASP.NET
5. 8. 9. Getting cookie values
5. 8. 10. Displaying additional path information in ASP.NET
5. 8. 11. Showing QueryString values via the QueryString Collection in ASP.NET
5. 8. 12. Displaying the HTTP headers collection in ASP.NET
5. 8. 13. Displaying the Request.FilePath property in ASP.NET
5. 8. 14. Request.Headers
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.