没有脚本任务,有没有办法检查文件是否存在?可能是foreach循环容器或其他东西。
最佳答案
我想出了如何在不使用脚本任务的情况下检查文件的方法。
1) Add a ForEach Loop Container to your Control Flow.
2) On ForEach Collection pane, set Enumerator to "Foreach File Enumerator"
3) Set Folder to your Source Folder.
4) Set Files to your File Spec (*.*).
5) On Variable Mappings, create new variable "User::FileExistsFileName"
6) You then just need to configure two output Lines for the ForEach Loop:
7) For Success Line: Double-click the Connector Line, set:
Evaluation operation: Expression
Value: Success
Expression: @[User::FileExistsFileName] != ""
8) For Failure Line, set:
Evaluation operation: Expression or Constraint
Value: Failure
Expression: @[User::FileExistsFileName] == ""
我想将“失败”的“评估”操作设置为“表达或约束”,只需将线变为红色即可。