コード例 #1
0
        public void RefreshInbox()
        {
            int i = 0;
            mCore.Inbox objInbox = objSMS.Inbox();

            try
            {
                objInbox.Refresh();
                inboxMessageList = new InboxMessagesCollection();
                foreach (mCore.Message Msg in objInbox)
                {
                    InboxMessages inboxMsg = new InboxMessages();
                    inboxMsg.Phone = Msg.Phone;
                    string messages = "Trial Version";
                    if (Verification.license() == true)
                    {
                        messages = Msg.Text;
                    }
                    inboxMsg.TextMessage = messages;
                    inboxMsg.TimeStamp = Msg.TimeStamp;
                    inboxMessageList.Add(inboxMsg);
                    i++;
                }
            }
            catch (mCore.SMSReadException ex)
            {
                returnMsg = ex.Message;
            }
            catch (mCore.GeneralException ex)
            {
                returnMsg = ex.Message;
            }
            catch (Exception ex)
            {
                returnMsg = ex.Message;
            }
        }
コード例 #2
0
        public InboxMessagesCollection Message(int index)
        {
            mCore.Inbox objInbox = objSMS.Inbox();
            mCore.Message Msg;
            try
            {
                Msg = objInbox.Message(index);
                inboxMessageList = new InboxMessagesCollection();
                InboxMessages msg = new InboxMessages();
                msg.Phone = Msg.Phone;
                msg.TextMessage = Msg.Text;
                msg.TimeStamp = Msg.TimeStamp;
                inboxMessageList.Add(msg);

                returnMsg = "Read Success";
                return inboxMessageList;
            }
            catch (mCore.SMSReadException ex)
            {
                returnMsg = ex.Message;
            }
            catch (mCore.GeneralException ex)
            {
                returnMsg = ex.Message;
            }
            catch (Exception ex)
            {
                returnMsg = ex.Message;
            }
            return null;
        }