我在lastwritetime超过16分钟时尝试发送电子邮件。这基本上是说文件在上一个周期中没有收到更新的图像。我的电子邮件是在16分钟后发送电子邮件,即使图像已更新。这是我正在使用的代码。
string files = @"\\cyclops-ch2-10\users\!SptEntEng\Desktop\ScreenScrapes\ChicagoSkyvision\ScreenScrape\ScreenScrape.png\";
string files1 = @"\\cyclops-ch2-10\users\!SptEntEng\Desktop\ScreenScrapes\ChicagoSeachange\ScreenScrape\ScreenScrape.png\";
string files2 = @"\\cyclops-ch2-10\users\!SptEntEng\Desktop\ScreenScrapes\IndianaSkyvision\ScreenScrape\ScreenScrape.png\";
string files3 = @"\\cyclops-ch2-10\users\!SptEntEng\Desktop\ScreenScrapes\IndianaSeachange\ScreenScrape\ScreenScrape.png\";
string files4 = @"\\cyclops-ch2-10\users\!SptEntEng\Desktop\ScreenScrapes\DetroitSkyvision\ScreenScrape\ScreenScrape.png\";
string files5 = @"\\cyclops-ch2-10\users\!SptEntEng\Desktop\ScreenScrapes\MichiganSeachange\ScreenScrape\ScreenScrape.png\";
string files6 = @"\\cyclops-ch2-10\users\!SptEntEng\Desktop\ScreenScrapes\LansingSkyvision\ScreenScrape\ScreenScrape.png\";
string files7 = @"\\cyclops-ch2-10\users\!SptEntEng\Desktop\ScreenScrapes\MinnesotaSeachange\ScreenScrape\ScreenScrape.png\";
string files8 = @"\\cyclops-ch2-10\users\!SptEntEng\Desktop\ScreenScrapes\HoustonSeachange\ScreenScrape\ScreenScrape.png\";
var FilePaths = new List<string>();
FilePaths.Add(files);
FilePaths.Add(files1);
FilePaths.Add(files2);
FilePaths.Add(files3);
FilePaths.Add(files4);
FilePaths.Add(files5);
FilePaths.Add(files6);
FilePaths.Add(files7);
FilePaths.Add(files8);
try
{
foreach (string file in FilePaths)
{
FileInfo fi = new FileInfo("ScreenScrape.png");
if (fi.LastWriteTime < DateTime.Now.AddMinutes(-16))
{
client.Send(CyclopsCentral);
break;
}
}