⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sms.cs

📁 老外Logix Mobile mCoreLib短信控件源码 通过串口或者手机数据线进行连接,可对手机进行 读写操作.
💻 CS
📖 第 1 页 / 共 5 页
字号:

        public string SendSMS(string DestinationNumber, string TextMessage)
        {
            SMS sms = this;
            mCore.SMS.d d = new mCore.SMS.d(ref sms, DestinationNumber, TextMessage, false, this.gm.bl, this.gm.bm, this.gm.bi, this.gm.bh);
            Thread thread = new Thread(new ThreadStart(d.a));
            thread.Name = "SendSMSMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string k = d.k;
            if (d != null)
            {
                d = null;
            }
            string str = k;
            this.a();
            return str;
        }

        public string SendSMS(string DestinationNumber, string TextMessage, bool AlertMessage)
        {
            SMS sms = this;
            mCore.SMS.d d = new mCore.SMS.d(ref sms, DestinationNumber, TextMessage, AlertMessage, this.gm.bl, this.gm.bm, this.gm.bi, this.gm.bh);
            Thread thread = new Thread(new ThreadStart(d.a));
            thread.Name = "SendSMSMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string k = d.k;
            if (d != null)
            {
                d = null;
            }
            string str = k;
            this.a();
            return str;
        }

        public string SendSMSToQueue(string DestinationNumber, string TextMessage)
        {
            SMS sms = this;
            mCore.SMS.d d = new mCore.SMS.d(ref sms, DestinationNumber, TextMessage, false, this.gm.bl, this.gm.bm, this.gm.bi, this.gm.bh);
            d.j = 2;
            Thread thread = new Thread(new ThreadStart(d.b));
            thread.Name = "SendSMSToQueueMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string k = d.k;
            if (d != null)
            {
                d = null;
            }
            string str = k;
            this.a();
            return str;
        }

        public string SendSMSToQueue(string DestinationNumber, string TextMessage, QueuePriority Priority)
        {
            SMS sms = this;
            mCore.SMS.d d = new mCore.SMS.d(ref sms, DestinationNumber, TextMessage, false, this.gm.bl, this.gm.bm, this.gm.bi, this.gm.bh);
            d.j = (int) Priority;
            Thread thread = new Thread(new ThreadStart(d.b));
            thread.Name = "SendSMSToQueueMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string k = d.k;
            if (d != null)
            {
                d = null;
            }
            string str = k;
            this.a();
            return str;
        }

        public string SendSMSToQueue(string DestinationNumber, string TextMessage, QueuePriority Priority, bool AlertMessage)
        {
            SMS sms = this;
            mCore.SMS.d d = new mCore.SMS.d(ref sms, DestinationNumber, TextMessage, AlertMessage, this.gm.bl, this.gm.bm, this.gm.bi, this.gm.bh);
            d.j = (int) Priority;
            Thread thread = new Thread(new ThreadStart(d.b));
            thread.Name = "SendSMSToQueueMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            string k = d.k;
            if (d != null)
            {
                d = null;
            }
            string str = k;
            this.a();
            return str;
        }

        public bool SendUSSD(string USSD_Command)
        {
            SMS sms = this;
            mCore.SMS.c c = new mCore.SMS.c(ref sms, "1,\"" + USSD_Command + "\",15");
            Thread thread = new Thread(new ThreadStart(c.a));
            thread.Name = "SendUSSDMethodThread";
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();
            while (thread.IsAlive)
            {
                Thread.Sleep(1);
                Application.DoEvents();
            }
            bool d = c.d;
            if (c != null)
            {
                c = null;
            }
            bool flag2 = d;
            this.a();
            return flag2;
        }

        private void t()
        {
            if (Monitor.TryEnter(this.gm, this.gm.@as))
            {
                try
                {
                    this.gm.av();
                    this.ab = this.gm.u();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    ProjectData.ClearProjectError();
                }
                finally
                {
                    Monitor.Exit(this.gm);
                }
            }
            else
            {
                this.gm.a(0x2333L, "Thread monitor enter attempt timeout [Connect_Method]", "GENERAL");
            }
        }

        private void u()
        {
            if (Monitor.TryEnter(this.gm, this.gm.@as))
            {
                try
                {
                    string str = "";
                    this.gm.av();
                    str = "SM";
                    switch (this.aa)
                    {
                        case mCore.MessageMemory.SM:
                            str = "SM";
                            break;

                        case mCore.MessageMemory.ME:
                            str = "ME";
                            break;

                        case mCore.MessageMemory.MT:
                            str = "MT";
                            break;
                    }
                    if (((str == "SM") | (str == "ME")) | (str == "MT"))
                    {
                        if (!this.gm.i(str))
                        {
                            this.gm.a(0x7d2L, "Error setting selected message memory", "GENERAL");
                        }
                    }
                    else if (this.gm.z == 0L)
                    {
                        this.gm.a(0x7d3L, "Invalid message memory setting", "GENERAL");
                    }
                }
                finally
                {
                    Monitor.Exit(this.gm);
                }
            }
            else
            {
                this.gm.a(0x2333L, "Thread monitor enter attempt timeout [MessageMemory_Set]", "GENERAL");
            }
        }

        private void v()
        {
            if (Monitor.TryEnter(this.gm, this.gm.@as))
            {
                try
                {
                    string str = "";
                    this.gm.av();
                    str = this.gm.t();
                    if (str.Length > 0)
                    {
                        switch (str.ToUpper())
                        {
                            case "SM":
                                this.z = mCore.MessageMemory.SM;
                                break;

                            case "ME":
                                this.z = mCore.MessageMemory.ME;
                                break;

                            case "MT":
                                this.z = mCore.MessageMemory.MT;
                                break;
                        }
                    }
                    else if (this.gm.z == 0L)
                    {
                        this.gm.a(0x7d1L, "Cannot read message memory setting", "GENERAL");
                    }
                }
                finally
                {
                    Monitor.Exit(this.gm);
                }
            }
            else
            {
                this.gm.a(0x2333L, "Thread monitor enter attempt timeout [MessageMemory_Get]", "GENERAL");
            }
        }

        public mCore.vCalendar vCalendar()
        {
            if (this.u == null)
            {
                SMS sms = this;
                this.u = new mCore.vCalendar(ref sms);
            }
            return this.u;
        }

        public mCore.vCard vCard()
        {
            if (this.t == null)
            {
                SMS sms = this;
                this.t = new mCore.vCard(ref sms);
            }
            return this.t;
        }

        public mCore.WapPush WapPush()
        {
            if (this.s == null)
            {
                SMS sms = this;
                this.s = new mCore.WapPush(ref sms);
            }
            return this.s;
        }

        public string About
        {
            get
            {
                return this.gm.ar();
            }
        }

        public bool AutoDeleteNewMessage
        {
            get
            {
                this.gm.av();
                return this.gm.x;
            }
            set
            {
                this.@as = value;
                Thread thread = new Thread(new ThreadStart(this.d));
                thread.Name = "AutoDeleteNewMessageSetThread";
                thread.Priority = ThreadPriority.Normal;
                thread.Start();
                while (thread.IsAlive)
                {
                    Thread.Sleep(1);
                    Application.DoEvents();
                }
                this.a();
            }
        }

        public int BatteryLevel
        {
            get
            {
                Thread thread = new Thread(new ThreadStart(this.h));
                thread.Name = "BatteryLevelGetThread";
                thread.Priority = ThreadPriority.Normal;
                thread.Start();
                while (thread.IsAlive)
                {
                    Thread.Sleep(1);
                    Application.DoEvents();
                }
                int ao = this.ao;
                this.a();
                return ao;
            }
        }

        public mCore.BaudRate BaudRate
        {
            get
            {
                mCore.BaudRate baudRate;
                this.gm.av();
                try
                {
                    baudRate = (mCore.BaudRate) this.gm.r().BaudRate;
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    this.gm.a.b("[SMS:BaudRate:1] " + exception.Message);
                    this.gm.r().BaudRate = 0x2580;
                    baudRate = (mCore.BaudRate) this.gm.r().BaudRate;
                    ProjectData.ClearProjectError();
                }
                return baudRate;
            }
            set
            {
                this.gm.av();
                if ((((((((((((((value == mCore.BaudRate.BaudRate_110) | (value == mCore.BaudRate.BaudRate_300)) | (value == mCore.BaudRate.BaudRate_1200)) | (value == mCore.BaudRate.BaudRate_2400)) | (value == mCore.BaudRate.BaudRate_4800)) | (value == mCore.BaudRate.BaudRate_9600)) | (value == mCore.BaudRate.BaudRate_14400)) | (value == mCore.BaudRate.BaudRate_19200)) | (value == mCore.BaudRate.BaudRate_38400)) | (value == mCore.BaudRate.BaudRate_57600)) | (value == mCore.BaudRate.BaudRate_115200)) | (value == mCore.BaudRate.BaudRate_230400)) | (value == mCore.BaudRate.BaudRate_460800)) | (value == mCore.BaudRate.BaudRate_921600))
                {
                    this.gm.r().BaudRate = (int) value;
                    this.r.b("BaudRate: " + ((int) value).ToString());
                }
                else
                {
                    this.gm.a(0x3ebL, "Invalid baudrate setting", "GENERAL");
                }
                this.a();
            }
        }

        public mCore.DataBits DataBits
        {
            get
            {
                mCore.DataBits dataBits;
                this.gm.av();
                try
                {
                    dataBits = (mCore.DataBits) this.gm.r().DataBits;
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    this.gm.a.b("[SMS:DataBits:1] " + exception.Message);
                    this.gm.r().DataBits = 8;
                    dataBits = (mCore.DataBits) this.gm.r().DataBits;
                    ProjectData.ClearProjectError();
                }
                return dataBits;
            }
            set
            {
                this.gm.av();
                if ((value >= mCore.DataBits.Four) & (value <= mCore.DataBits.Eight))
                {
                    this.gm.r().DataBits = (int) value;
                    this.r.b("DataBits: " + ((int) value).ToString());
                }
                else
                {
                    this.gm.a(0x3edL, "Invalid data bits setting", "GENERAL");
                }
                this.a();
            }
        }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -