HttpRequest.InputStream プロパティ

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

Public ReadOnly Property InputStream As Stream
[C#]
public Stream InputStream {get;}
[C++]
public: __property Stream* get_InputStream();
[JScript]
public function get InputStream() : Stream;

プロパティ値

受信 HTTP コンテンツ本体の内容を表す Stream オブジェクト。

使用例

[Visual Basic, JScript] この例では、 InputStream の内容を文字列にコピーします。

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

[C#, C++] C# および C++ のサンプルはありません。Visual Basic および JScript のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ

参照

HttpRequest クラス | HttpRequest メンバ | System.Web 名前空間