Tanggal SMS Receive ActiveXpert

Discussion in 'Programming & Reverse Engineering' started by kopiceblek, Oct 14, 2009.

  1. kopiceblek

    kopiceblek Member

    Messages:
    33
    Likes Received:
    5
    Trophy Points:
    18
    Aku bikin aplikasi sederhana pake VB.NET, nampilin SMS yang ada di HP. :D

    Code:
    Imports AXmsCtrl
    
    Public Class Form1
    
        Private objGsmProtocol As SmsProtocolGsm
        Private objConstants As SmsConstants
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            ListView1.Items.Clear()
            ListView1.Columns.Clear()
            ListView1.Columns.Add("No.", 50, HorizontalAlignment.Left)
            ListView1.Columns.Add("Date", 150, HorizontalAlignment.Left)
            ListView1.Columns.Add("Sender", 150, HorizontalAlignment.Left)
            ListView1.Columns.Add("Message", 500, HorizontalAlignment.Left)
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim objSmsMessage As SmsMessage
            objGsmProtocol = New SmsProtocolGsm
            objConstants = New SmsConstants
    
            ListView1.Items.Clear()
            objGsmProtocol.Clear()
            objGsmProtocol.Device = "COM3"
            objGsmProtocol.DeviceSpeed = System.Int32.Parse(0)
            objGsmProtocol.MessageStorage = objConstants.asSTORAGE_ALL
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
    
            objGsmProtocol.Receive()
            If (objGsmProtocol.LastError = 0) Then
    
                Dim str(4) As String
                Dim no As Integer
                Dim itm As ListViewItem
    
                objSmsMessage = objGsmProtocol.GetFirstMessage()
                no = 1
    
                While (objGsmProtocol.LastError = 0)
                    str(0) = no
                    str(1) = objSmsMessage.Time
                    str(2) = objSmsMessage.Sender
                    str(3) = objSmsMessage.Data
                    no = no + 1
                    itm = New ListViewItem(str)
                    ListView1.Items.Add(itm)
                    objSmsMessage = objGsmProtocol.GetNextMessage()
                End While
    
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
    
            End If
        End Sub
    End Class
    
    Sender & isi SMS sudah ditampilkan dengan benar, tapi kenapa tanggal & waktu receive nya sama semua ya?
    tanggal & waktu receive nya kalo aku perhatikan adalah waktu saat aplikasi tsb dijalankan.

    Minta masukan & koreksinya nya, TQ b4 ;)
     
  2. babehhuey

    babehhuey New Member

    Messages:
    51
    Likes Received:
    10
    Trophy Points:
    0
    pertamaxxxkah?????????:focus:
     

Share This Page