事件没有在Windows服务中触发

时间:2014-07-05 10:04:14

标签: c# asp.net windows-services

public void testUssdResponse()
{
     //modem is connected fine here before returning result
     bool result = smsObject.SendUSSD("*1234#");
     if (result)
     {
          smsObject.NewUSSDReceived += smsObject_NewUSSDReceived;
          smsObject.NewUSSDIndication = true;
     }
}

下面是我期待触发的事件

  public void smsObject_NewUSSDReceived(object sender, mCore.NewUSSDReceivedEventArgs e)
  {
        string message = e.Message.ToString();
        string status = e.Status.ToString();

         if (message == "welcome user")
         {
         }
         else
         {
         }
    }

我需要看到的部分是从事件返回的消息,但是当我应用断点时,我无法导航到代码本身。计时器已经过了,我正在运行testUssd下面的函数

 void tm_Elapsed(object sender, ElapsedEventArgs e)
 {
        timer.Interval = (1000 * 60);
        testUssdResponse();
        timer.Interval = 1000 * 60;
 }

0 个答案:

没有答案