HttpRequest.InputStream プロパティとは何? わかりやすく解説 Weblio辞書 (original) (raw)

受信 HTTP エンティティ本体内容取得します

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文構文

Visual Basic (宣言)

Public ReadOnly Property InputStream As Stream

Visual Basic (使用法)

Dim instance As HttpRequest Dim value As Stream

value = instance.InputStream

C#

public Stream InputStream { get; }

C++

public: property Stream^ InputStream { Stream^ get (); }

J#

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

JScript

public function get InputStream () : Stream

プロパティ
受信 HTTP コンテンツ本体内容を表す Stream オブジェクト

使用例使用例

InputStream内容文字列コピーするコード例次に示します

Visual Basic

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

JScript

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();

プラットフォームプラットフォーム

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 によってサポートされていないバージョンありますサポートされているバージョンについては、「システム要件」を参照してください

バージョン情報バージョン情報

.NET Framework
サポート対象 : 2.01.11.0

参照参照

関連項目
HttpRequest クラス
HttpRequest メンバ
System.Web 名前空間