0
我知道網站上的很多示例都是用C#編寫的,但是我想調用Quartz的.NET函數/方法,並且使用VB.Net。如何調用Quartz的.NET函數/方法
許多例子說明如何打開文件/應用/ EXE等是外部到.NET ...但我想打電話給我如何能做到這一點的東西內部(VB函數/方法)
請?可能嗎?
請參閱下文。
'define the job and tie it to our HelloJob class
IJobDetail job = JobBuilder.Create<HelloJob>()
.WithIdentity(myMethod(), "group1")
.Build();
Sub myMethod()
MsgBox("YES")
End Sub
您不調用Quart的方法,但Quartz調度程序調用您的方法。創建一個實現IJob的類。在那個類中添加一個方法Execute()並將你的類傳遞給Quart.Net。安排工作,運行Quartz,它會調用你的Execute()方法。 – derloopkat
非常感謝!請你能給我一個VB.Net的例子。即使是C#,如果你不能寫VB.Net代碼。 – Jane
我已經將一個C#代碼示例翻譯成VB.Net並正常工作。只需要將NuGet包中的Quartz.Net添加到VB.Net控制檯項目並使用該代碼即可。 – derloopkat