mardi 5 mai 2015

Check for multiple missing files in VB.Net

I process around 10 files each day and the naming convention of the files are MMDDYY_FileName. I currently have a SSIS package to load these files but I don’t have anything in place that tells me if any of the files missing. I want to be able to send an email if any of the files are missing with the missing file names included in the email. I know how to write a simple vb.net code for checking a single file but not sure how I can check for multiple files and store the missing file names. Can someone please provide me an example of checking two or more missing files? Below is the code I have so far for checking a single file:

If (File.Exists(CStr(Dts.Variables("filePath").Value))) Then
  Dts.TaskResult = Dts.Results.Success
Else
  Dts.TaskResult = Dts.Results.Failure

Aucun commentaire:

Enregistrer un commentaire