コード例 #1
0
        public SMSClient()
        {
            // var config = new AppConfiguration();

            device = new Modem("80");
            device.OnErrorMessage += Device_OnErrorMessageAsync;
            device.OnReciveSMS    += Device_OnReciveSMS;
            device.OnSendingSMS   += Device_OnSendingSMS;
            device.Signature       = "Trireksa";
            var result = device.Connect();

            CompleteTask(result);
        }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();
            this.list        = new List <string>();
            this.Source      = (CollectionView)CollectionViewSource.GetDefaultView(list);
            this.DataContext = this;
            list.Add("test");
            this.Display         += MainWindow_Display1;;
            this.modem            = new OcphSMSLib.Modem("COM5");
            modem.OnErrorMessage += Modem_OnErrorMessage;
            modem.OnReciveSMS    += Modem_OnReciveSMS;
            modem.OnRecive       += Modem_OnRecive;
            var isconect = modem.Connect();

            CompleteConnected(isconect);
        }
コード例 #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            MyConfiguration config = new MyConfiguration();

            try
            {
                this.modem = new Modem(config.DevicePort);

                this.modem.OnReciveSMS  += Modem_OnReciveSMS;
                this.modem.OnSendingSMS += Modem_OnSendingSMS;


                modem.Connect();
            }
            catch (Exception ex)
            {
                throw new SystemException(ex.Message);
            }
        }
コード例 #4
0
 public void Connect()
 {
     Modem.Connect();
 }