Exemple #1
0
        static void Main(string[] args)
        {
            SMSTimer timer = new SMSTimer();

            timer.Start();
            Console.Read();
            timer.Stop();

            /*receiveNow = new AutoResetEvent(false);
             *
             * _port = new SerialPort("COM2", 9600)
             * {
             *  DataBits = 8,
             *  StopBits = StopBits.One,
             *  Parity = Parity.None,
             *  ReadTimeout = TimeOut,
             *  WriteTimeout = TimeOut,
             *  DtrEnable = true,
             *  RtsEnable = true,
             *  NewLine = Environment.NewLine,
             *  Encoding = Encoding.GetEncoding("iso-8859-1"),
             * };
             * _port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
             *
             * try
             * {
             *
             * }
             * catch (Exception ex)
             * {
             *  _port.Close();
             *  Console.WriteLine($"SetUp >> Device not connected >> {ex.Message}");
             *  return;
             * }
             *
             * Connected = true;
             * var Storage = (true) ? "SM" : "ME";
             * ExeCommand($"AT+CMGF=1{(char)(13)}");               //Set Text Mode to Text
             * ExeCommand($"AT+CPMS=\"{Storage}\"{(char)(13)}");   //Set Text Storage
             * Console.WriteLine($"Device is connected and ready");
             *
             * ExeCommand(@"AT" + (char)(13));
             * ExeCommand(@"AT+CMGL=""ALL""" + (char)(13));
             * Console.Read();*/
        }
Exemple #2
0
 public SMSService()
 {
     InitializeComponent();
     tool = new SMSTimer();
 }