LastActivity = "Create object Fso"; object? Fso = Activator.CreateInstance(Type.GetTypeFromProgID("Scripting.FileSystemObject"));
'Create objects sLastActivity = "Create object oFso" Set oFso = CreateObject("Scripting.FileSystemObject")
LastActivity = "Writing log file"; Log = Log + Environment.NewLine + "RoboArchiveManager finished at " + DateTime.Now.ToString() + Environment.NewLine + Environment.NewLine; File.WriteAllText(FileLog, Log);
string[] AttachmentFiles = Directory.GetFiles(ReportSourceRootFolder, "*.pdf", SearchOption.AllDirectories); LastActivity = String.Concat("report", AttachmentFiles); foreach (string AttachmentFile in AttachmentFiles) { var fileInfo = new FileInfo(AttachmentFile); if (File.GetLastWriteTime(AttachmentFile) < DateTime.Now - TimeSpan.FromMilliseconds(500) && fileInfo.Extension == ".pdf" && !AttachmentFile.StartsWith("~")) { Archive(AttachmentFile, AttachmentDestRootFolder); } }