我创建了 10 个不同的包,我想从 c# 编码中执行它们。有人可以发布一些屏幕截图来实现这一点。我试过这个
Application app = new Application();
TraceService("loading system From File system");
//Create package Container to hold the package.
//And Load the Package Using the Application Object.
Package package = app.LoadPackage(@"C:\User\Kiran\Documents\Visual Studio 2012\Projects\WindowsServiceTest\WindowsServiceTest\Package1.dtsx", null);
TraceService("Execution Started");
DTSExecResult result = package.Execute();
// print the result
TraceService(result.ToString());
TraceService("Execution Completed");
在这里,我必须在运行时获取文件名,而不是通过硬编码