Use DispatcherTimer with Windows Service

后端 未结 1 743
失恋的感觉
失恋的感觉 2021-01-19 19:57

Why my DispatcherTimer don\'t work with Windows Service .

The purpose behind that i want use DispatcherTimer for check a windows service License

             


        
1条回答
  •  失恋的感觉
    2021-01-19 20:55

    The point of DispatcherTimer is to fire its Tick event on the dispatcher thread. That's important because you can only manipulate Silverlight/WPF UI elements on the dispatcher thread. In a Windows Service, there is no dispatcher thread... there's no UI to manipulate. Why would you want to use a DispatcherTimer instead of (say) System.Timers.Timer?

    0 讨论(0)
提交回复
热议问题