Beispiel #1
0
        /// <summary>
        /// 发送邮件
        /// </summary>
        /// <param name="targetDirInfo"></param>
        /// <param name="ms"></param>
        public static void SendMail(DirectoryInfo targetDirInfo, Entities.monitorServer ms)
        {
            double        line = new AppConfig().getSpaceWarnline();
            StringBuilder strB = new StringBuilder();

            strB.Append("\"").Append(targetDirInfo.Root.FullName).Append("\": This disk space is insufficient.\r\n     There are less than ").Append(line).Append("G space left.\r\n\r\n")
            .Append("monitorServer info:\r\n")
            .Append("  monitorID: ").Append(ms.id).Append(";\r\n")
            .Append("  monitorServerName: ").Append(ms.monitorServerName).Append(";\r\n")
            .Append("  monitorServerIP: ").Append(ms.monitorServerIP).Append(";\r\n")
            .Append("  memo: ").Append(ms.memo).Append(";\r\n")
            .Append("  startFile: ").Append(ms.startFile).Append(";\r\n")
            .Append("  monitorMacPath: ").Append(ms.monitorMacPath).Append(";\r\n")
            .Append("  monitorLocalPath: ").Append(ms.monitorLocalPath).Append(".\r\n");
            //发送
            new SendMail().SendEmail(strB.ToString());
        }
Beispiel #2
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="monitorserverfolder"></param>
 public void Edit(Entities.monitorServer monitorServer)
 {
     db.Entry(monitorServer).State = EntityState.Modified;
     db.SaveChanges();
 }
Beispiel #3
0
 /// <summary>
 /// 監視リスト取得
 /// </summary>
 /// <returns></returns>
 public Entities.monitorServer GetMonitorServerById(int id)
 {
     Entities.monitorServer monitorServer = db.monitorServers.Find(id);
     return(monitorServer);
 }