Export (0) Print
Expand All

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

Not applicable.

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 System.IO.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 Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft