该例自定义了一个将实例持久化到磁盘文的操作,分两部分
第一部分是实现PersistenceService类,第二部分是操作磁盘的功能类,本例中的[test]是一个自定义的console的输出类,功能就是实现console.write("内容")

实现PersistenceService类
自定义PersistenceService类Imports System
自定义PersistenceService类
Imports System.Workflow.ComponentModel
自定义PersistenceService类
Imports System.Workflow.Runtime.Hosting
自定义PersistenceService类
Imports System.Collections.Specialized
自定义PersistenceService类
Imports System.Workflow.Runtime
自定义PersistenceService类
End Class

操作磁盘的功能类

自定义PersistenceService类Imports System.IO
自定义PersistenceService类
Imports System.IO.Compression
自定义PersistenceService类
自定义PersistenceService类
'该类是将工作流实例保存到磁盘、从磁盘上加载的实体操作类
自定义PersistenceService类


然后象加载SqlWorkflowPersistenceService类一样使用就可以了

自定义PersistenceService类Dim 引擎 As WorkflowRuntime = New WorkflowRuntime()
自定义PersistenceService类
Dim 自定义PS As New 自定义Persistence服务(True'为真时,引擎自动对进入idle模式的实例,调用Unload方法,
自定义PersistenceService类
引擎.AddService(自定义PS)
自定义PersistenceService类

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
猜你喜欢
  • 2021-11-20
  • 2021-07-01
  • 2021-07-10
  • 2022-01-15
  • 2021-12-02
  • 2022-01-10
相关资源
相似解决方案