1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Imports System
Imports System.Web
Public Class FullScreenClass
Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest
' Les différentes déclarations.
Id = context.Request.QueryString("Id")
' Les différents tests (authentification...), récupération du chemin du fichier PathFilePDF
If IO.File.Exists(PathFilePDF) Then
FileStreamObj = New IO.FileStream(PathFilePDF, IO.FileMode.Open)
context.Response.AddHeader("content-type", "application/pdf")
ReDim Buffer(FileStreamObj.Length)
FileStreamObj.Read(Buffer, 0, FileStreamObj.Length)
FileStreamObj.Close()
context.Response.BinaryWrite(Buffer)
End If
End Sub
Public ReadOnly Property IsReusable() As Boolean Implements System.Web.IHttpHandler.IsReusable
Get
Return True
End Get
End Property
End Class |