HttpRequest.InputStream-Eigenschaft
Ruft den Inhalt des eingehenden HTTP-Einheitentextes ab.
Namespace: System.Web
Assembly: System.Web (in system.web.dll)
Syntax
'Declaration
Public ReadOnly Property InputStream As Stream
'Usage
Dim instance As HttpRequest
Dim value As Stream
value = instance.InputStream
public Stream InputStream { get; }
public:
property Stream^ InputStream {
Stream^ get ();
}
/** @property */
public Stream get_InputStream ()
public function get InputStream () : Stream
Eigenschaftenwert
Ein Stream-Objekt, das den Inhalt des eingehenden HTTP-Einheitentextes darstellt.
Beispiel
Im folgenden Codebeispiel wird der Inhalt eines InputStream in eine Zeichenfolge kopiert.
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
var str : Stream
var sb : StringBuilder = new StringBuilder()
var strmContents : String
var strLen, strRead : int
str = Request.InputStream // Create a Stream object.
strLen = str.Length // Find number of Bytes in stream.
var strArr: Byte[] = new Byte[strLen] // Create a Byte array.
strRead = str.Read(strArr,0,strLen) // Read stream into Byte array.
// Convert Byte array to a text string.
for(var counter=0; counter < strLen; counter++){
sb.Append(strArr[counter].ToString())
}
strmContents = sb.ToString();
Plattformen
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
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0