FORM 里面测试,源代码:
Button_click()
Dim serviceProcessor As IQC = GetObject("queue:/new:QC")
serviceProcessor.Integrate(Year)
Marshal.ReleaseComObject(serviceProcessor)
serviceProcessor = Nothing
end sub
Windows Service, 源代码:
Private Sub Timer_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer.Elapsed
Timer.Interval = 10000
Timer.Enabled = False
Dim Year As Integer = 2004
Dim serviceProcessor As IQC = GetObject(_queueMoniker)
serviceProcessor.Integrate(Year)
Marshal.ReleaseComObject(serviceProcessor)
serviceProcessor = Nothing
Timer.Enabled = True
End Sub
当运行Windows Service, 错误信息如下:
event Viewer--> Application
Category Id=101, Event ID=4808
An unexpected error was returned by the Message Queuing API MQSendMessage : A cryptographic function failed.
Button_click()
Dim serviceProcessor As IQC = GetObject("queue:/new:QC")
serviceProcessor.Integrate(Year)
Marshal.ReleaseComObject(serviceProcessor)
serviceProcessor = Nothing
end sub
Windows Service, 源代码:
Private Sub Timer_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer.Elapsed
Timer.Interval = 10000
Timer.Enabled = False
Dim Year As Integer = 2004
Dim serviceProcessor As IQC = GetObject(_queueMoniker)
serviceProcessor.Integrate(Year)
Marshal.ReleaseComObject(serviceProcessor)
serviceProcessor = Nothing
Timer.Enabled = True
End Sub
当运行Windows Service, 错误信息如下:
event Viewer--> Application
Category Id=101, Event ID=4808
An unexpected error was returned by the Message Queuing API MQSendMessage : A cryptographic function failed.