这样已经读取了所有短信(包括被分割成N条后发送进来的短信)
读取现有短信
如果要读取SIM卡中的现有短信,可以使用下面的代码:
If
FoxSMS.Ready = False Then
MessageBox.show("请先连接短信猫!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
End If
Dim cnt As Integer = FoxSMS.SimMsgCount
If cnt > 0 Then '如果SIM卡有短信
Dim sendtime As String
Dim strFrom As String
Dim strContent As String
Dim result As Integer
FoxSMS.AutoDelMsg = True '自动从SIM卡删除已经读取的短信
Tables("收件箱").StopRedraw()
For Index As Integer = 1 To FoxSMS.SimMsgCapacity
result = FoxSMS.ReadMsgForIndex(Index, strFrom, strContent, sendtime)
If result = 0 Then
Dim dr As Row = Tables("收件箱").AddNew()
dr("号码") = strFrom
dr("内容") = strContent
dr("发送时间") = SendTime
dr("接收时间") = Date.Now
End If
Next
Tables("收件箱").DataTable.Save()
Tables("收件箱").ResumeRedraw()
End If