目標: メモリ内にバイト配列としてサムネイルがあります。ユーザーが画像をアップロードしたら、データベースに書き込む前に httphandler に表示したいと考えています。このコードを使用して、データベースから正常に読み取り、表示しました。しかし今、私はセッションからそれを表示したい:
Public Sub ProcessRequest(ByVal context As HttpContext) _
Implements IHttpHandler.ProcessRequest
Dim oPhotoMgt As New PhotoMgt
Dim intPhotoID As Int32 = context.Request.QueryString("id")
Dim oPhoto As New Photo
oPhoto = oPhotoMgt.GetPhotoByID(intPhotoID)
context.Response.ContentType = "image/jpeg"
context.Response.BinaryWrite(oPhoto.Bytes.ToArray())
End Sub