HttpRequest.InputStream プロパティとは何? わかりやすく解説 Weblio辞書 (original) (raw)
名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文
Public ReadOnly Property InputStream As Stream
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
プロパティ値
受信 HTTP コンテンツ本体の内容を表す Stream オブジェクト。
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
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。