Private mobjIF As New Interfax.Inbound() Private Items() As Interfax.MessageItem Private b() As Byte Private Sub btnGetList_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGetList.Click Dim intResult As Integer Me.lstMsgs.Items.Clear() Me.lstMsgs.Items.Add("Getting data from server, please wait...") Me.ComboBox1.SelectedIndex = 0 Me.Refresh() intResult = mobjIF.GetList(Me.txtUser.Text, Me.txtPass.Text, Interfax.ListType.NewMessages, Me.txtNumItems.Text, Items) Select Case intResult Case 0 ShowList() Case Else MsgBox("An error occured. Code=" & intResult) End Select End Sub Private Sub ShowList() Dim i As Integer Dim strLine As String Me.lstMsgs.Items.Clear() For i = 0 To Items.Length - 1 With Items(i) strLine = "(" & (i + 1).ToString & ") " & .Pages & " Page(s) Received at " & .ReceiveTime & " Caller ID=[" & .CallerID & "] CSID=[" & .RemoteCSID & "]" End With Me.lstMsgs.Items.Add(strLine) Next Me.Refresh() End Sub Private Sub lstMsgs_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstMsgs.DoubleClick Dim i As Integer Dim intResult As Integer StatusBar1.Text = "Retreiving message, please wait" i = Me.lstMsgs.SelectedIndex b = Nothing 'Do not send data for outbound-only parameter intResult = mobjIF.GetImageChunk(Me.txtUser.Text, Me.txtPass.Text, Items(i).MessageID, False, Items(i).MessageSize, 0, b) Select Case intResult Case 0 ShowImage() Case Else MsgBox("An error occured. Code=" & intResult) End Select End Sub Private Sub ShowImage() Dim strPath As String strPath = IO.Path.GetTempFileName & "." & Me.ComboBox1.Text Dim fs As New IO.FileStream(strPath, IO.FileMode.Create) StatusBar1.Text = FormatNumber(b.Length / 1024, 0, TriState.True, TriState.False, TriState.True) & " KBytes received" fs.Write(b, 0, b.Length) fs.Close() fs = Nothing System.Diagnostics.Process.Start(strPath) End Sub End Class