DisplayFromHTTP(String,String,Int32) Method
Loads a document from a file stored on a distant server using HTTP transfer according to what you have specified and subsequently displays it in the GdViewer control. The file transfer will be run asynchronously. The document previously displayed in the control will automatically close.
All document formats currently supported by the toolkit are listed here.
The DataReceived event is raised to allow you to monitor the transferred data. Likewise, the TransferEnded event is raised right after the transfer will finish.
public function DisplayFromHTTP(
: String;
: String;
: Integer
): GdPictureStatus;
public function DisplayFromHTTP(
: String,
: String,
: int
) : GdPictureStatus;
'Declaration
Public Overloads Function DisplayFromHTTP( _
ByVal As String, _
ByVal As String, _
ByVal As Integer _
) As GdPictureStatus
Parameters
- Host
- The name of the host server, where the file is located, for example http://www.gdpicture.com.
- Path
- The file path on the host server for the document to display, for example /demo/image.jpg.
- HTTPPort
- The HTTP port number used. It is usually 80 for usage of the HTTP or 443 for usage of the HTTPS transfer mode.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
Use the GetLastTransferError method to diagnose the error if this method has failed with one of the GdPictureStatus.Internet... errors.
How to display your image from a distant server using the HTTP transfer.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromHTTP("www.mywebsite.com", "/demo/image.tif", 443) = GdPictureStatus.OK Then
'Do your stuff here.
Else
MessageBox.Show("This file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.DisplayFromHTTP")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromHTTP("www.mywebsite.com", "/demo/image.tif", 443) == GdPictureStatus.OK)
{
//Do your stuff here.
}
else
{
MessageBox.Show("This file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.DisplayFromHTTP");
}