GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / GetLastTransferError Method
Example





In This Topic
GetLastTransferError Method (GdViewer)
In This Topic
Returns the error description of the last executed HTTP or FTP transfer operation with this GdViewer control, if that has failed specifically with one of the GdPictureStatus.Internet... errors.
Syntax
'Declaration
 
Public Function GetLastTransferError() As String
public string GetLastTransferError()
public function GetLastTransferError(): String; 
public function GetLastTransferError() : String;
public: string* GetLastTransferError(); 
public:
String^ GetLastTransferError(); 

Return Value

The description of the last transfer error.
Remarks
The value resets to its default (an empty string) starting each new transfer operation.
Example
How to properly retrieve the error description of the last transfer operation if that operation has failed.
'We assume that the GdViewer1 control has been properly integrated.
Dim status As GdPictureStatus = GdViewer1.DisplayFromFTP("ftp://ftp.mywebsite.com/mydocument.pdf", "mylogin", "mypassword")
If status <> GdPictureStatus.OK Then
    If status = GdPictureStatus.InternetConnectError Then
        'Use the GetLastTransferError() method here to find the reason for the failure.
        MessageBox.Show("Internet connection error: " + GdViewer1.GetLastTransferError(), "GdViewer.GetLastTransferError")
    End If
End If
//We assume that the GdViewer1 control has been properly integrated.
GdPictureStatus status = GdViewer1.DisplayFromFTP("ftp://ftp.mywebsite.com/mydocument.pdf", "mylogin", "mypassword");
if (status != GdPictureStatus.OK)
{
    if (status == GdPictureStatus.InternetConnectError)
        //Use the GetLastTransferError() method here to find the reason for the failure.
        MessageBox.Show("Internet connection error: " + GdViewer1.GetLastTransferError(), "GdViewer.GetLastTransferError");
}
See Also