'We assume that the GdViewer1 control has been properly integrated.
Dim file As System.IO.Stream = New System.IO.FileStream("text.txt", System.IO.FileMode.Open)
If GdViewer1.DisplayFromStream(file, "", GdPicture14.DocumentFormat.DocumentFormatTXT) = GdPictureStatus.OK Then
'Do your stuff here.
Else
MessageBox.Show("This file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.DisplayFromStream")
End If
file.Dispose()
//We assume that the GdViewer1 control has been properly integrated.
System.IO.Stream file = new System.IO.FileStream("text.txt", System.IO.FileMode.Open);
if (GdViewer1.DisplayFromStream(file, "", GdPicture14.DocumentFormat.DocumentFormatTXT) == GdPictureStatus.OK)
{
//Do your stuff here.
}
else
{
MessageBox.Show("This file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.DisplayFromStream");
}
file.Dispose();