InputStream Property

HttpRequest.InputStream Property

Gets the contents of the incoming HTTP entity body.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

'Declaration
Public ReadOnly Property InputStream As Stream
'Usage
Dim instance As HttpRequest
Dim value As Stream

value = instance.InputStream

/** @property */
public Stream get_InputStream ()

public function get InputStream () : Stream

Property Value

A Stream object representing the contents of the incoming HTTP content body.

The following code example copies the contents of an InputStream into a string.

Dim str As Stream, strmContents As String
Dim counter, strLen, strRead As Integer
 
' Create a Stream object.
str = Request.InputStream
' Find number of bytes in stream.
strLen = CInt(str.Length)
' Create a byte array.
Dim strArr(strLen) As Byte 
' Read stream into byte array.
strRead = str.Read(strArr,0,strLen) 
 
' Convert byte array to a text string.
For counter = 0 To strLen-1
   strmContents = strmContents & strArr(counter).ToString()
Next counter
 

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2016 Microsoft