public UpdateFile ReadUpdateFile(UpdateFile file) { using (StreamReader reader = new StreamReader(file.filepath)) { string line = reader.ReadToEnd(); file.FileTimestamp = Convert.ToDateTime(line); reader.Close(); } return(file); }
private bool CompareTimeForUpdate(UpdateFile file) { DateTime nextUpdateDate = file.FileTimestamp.AddDays(DaysNextUpdate); if ((DateTime.Compare(nextUpdateDate, DayTimeToday)) <= 0) { return true; } else { return false; } }
private bool CompareTimeForUpdate(UpdateFile file) { DateTime nextUpdateDate = file.FileTimestamp.AddDays(DaysNextUpdate); if ((DateTime.Compare(nextUpdateDate, DayTimeToday)) <= 0) { return(true); } else { return(false); } }
public void createUpdateFile(UpdateFile file) { using (FileStream fs = File.Create(file.filepath)) { fs.Close(); } using (StreamWriter sw = new StreamWriter(file.filepath)) { DateTime timeStamp = new DateTime(file.FileTimestamp.Ticks); sw.Write(timeStamp); DirectoryInfo dInfo = new DirectoryInfo(file.filepath); File.SetAttributes(file.filepath, FileAttributes.Hidden); sw.Close(); } }
public void WriteUpdateFile(UpdateFile file) { try { File.Delete(file.filepath); } catch (Exception e) { throw new Exception(e.StackTrace); } DirectoryInfo dInfo = new DirectoryInfo(file.filepath); using (StreamWriter writer = new StreamWriter(file.filepath, true)) { writer.Write(file.FileTimestamp); writer.Close(); } }
public UpdateDownloader(UpdateFile file) { _updateFile = file; }
public UpdateFile ReadUpdateFile(UpdateFile file) { using (StreamReader reader = new StreamReader(file.filepath)) { string line = reader.ReadToEnd(); file.FileTimestamp = Convert.ToDateTime(line); reader.Close(); } return file; }
public void DownloadUpdate(UpdateFile file, JObject check) { UpdateDownloader UpdateDownloader = new UpdateDownloader(file); UpdateDownloader.downloadUpdate(check); }