System.Web Namespace HttpResponse Class
Writes a string of binary characters to the HTTP output stream.
[ VB ]
Public Sub BinaryWrite ( _
ByVal buffer ( ) As Byte _
)
[ C# ]
public void BinaryWrite (
byte [ ] buffer
);
[ C++ ]
public: void BinaryWrite (
unsigned char buffer __gc [ ]
);
[ JScript ]
public function BinaryWrite (
buffer : Byte [ ]
);
- buffer
- The bytes to write to the output stream.
The following example shows how you can write the string of binary characters from an image column to the HTTP output stream.
void Page_Load ( object o, EventArgs e ) {
string id = Request.Params [ "id" ];
byte [ ] logo = ( byte [ ] ) fetchScalar (
"select logo from pubs_pub_info where pub_id='" + id + "'" );
Response.ContentType = "image/GIF";
Response.BinaryWrite ( logo );
}
Sub Page_Load ( o As Object, e As EventArgs )
Dim id As String = Request.Params ( "id" )
Dim logo As Byte ( ) = CType ( fetchScalar ( _
"select logo from pubs_pub_info where pub_id='" + id + "'" ), Byte ( ) )
Response.ContentType = "image/GIF"
Response.BinaryWrite ( logo )
End Sub |
|
C# |
VB |
Show me
Request.BinaryRead HttpResponse Members