Exemplo n.º 1
0
        public void SendTcpConnection()
        {
            Header header = new Header("TMMIN", "SMS-GW", "sendSMS");
            Request request = new Request(null, header, null);
            QueueWorkItem item = new QueueWorkItem();
            item.Command = string.Format(GSMClient.Command.CommandCollection.SMSSend, "082125164012", "hallo");
            item.Enabled = true;
            DailyTrigger trigger = new DailyTrigger();
            trigger.RecursEvery = 1;
            item.Schedule = trigger;

            try
            {
                IKeySym keySym = new PrivateKey();
                request.QueueWorkItem = item;
                GSMClient.BaseGSMCommand dbCommand = new GSMClient.TcpCommand("192.168.0.198", 13005, keySym);
                dbCommand.Connection.Open();
                dbCommand.Request = request;
                dbCommand.Write();
                dbCommand.Connection.Close();
            }
            catch (Exception)
            {

            }
        }
Exemplo n.º 2
0
        public void InserDailyTrigger()
        {
            Header header = new Header("FRITZ", "SMS-GW", "sendSMS");
            Request request = new Request(null, header, null);
            QueueWorkItem item = new QueueWorkItem();
            item.Command = string.Format(GSMClient.Command.CommandCollection.SMSSend, "082125164012", "hai");
            item.Enabled = true;
            DailyTrigger trigger = new DailyTrigger();
            trigger.RecursEvery = 1;
            item.Schedule = trigger;

            IKeySym keySym = new PrivateKey();
            request.QueueWorkItem = item;
            GSMClient.BaseGSMCommand dbCommand = new GSMClient.DbCommand("Data Source=.;Initial Catalog=SMSGW;User Id=sa;Password=sa123;Integrated Security=False;MultipleActiveResultSets=True", "System.Data.SqlClient");
            dbCommand.Request = request;
            dbCommand.Write();
        }