public void WriteLog(taskManagement task) { StringBuilder sb = new StringBuilder(); String lstName = task.returnLst(); String path = task.returnPath(); String taskName = task.returnTaskName(); String ID = task.returnID(); String backupType = task.returnBackupType(); String Source = task.returnSource(); String Destination = task.returnDestination(); String Schedule = task.returnSchedule(); sb.AppendLine(lstName); sb.AppendLine(path); sb.AppendLine(taskName); sb.AppendLine(ID); sb.AppendLine(backupType); sb.AppendLine(Source); sb.AppendLine(Destination); sb.AppendLine(Schedule); using (StreamWriter outfile = File.AppendText(logPath + "\\Log.txt")) { //write log into .txt outfile.Write(sb.ToString()); } }
public void createNewTask(String lstName, String path, String taskName, String ID, String backupType, String Source, String Destination, String Schedule) { taskManagement t = new taskManagement(lstName, path, taskName, ID, backupType, Source, Destination, Schedule); tasks.Add(t); writeLog(t); }