public void DeserializeJobs() { try { using (Stream stream = File.Open("Jobsdata.bin", FileMode.Open)) { PostedJobsLog log = PostedJobsLog.Create; BinaryFormatter bin = new BinaryFormatter(); var profiles = (List <PostedJobs>)bin.Deserialize(stream); foreach (var x in profiles) { if (log.Contains(x.Name) == false) { if (x.Name.Length > 3) { log.JobsList.Add(x); } } } } } catch (IOException) { } }
private string MatchTR(string p, DateTime date1, DateTime date2, bool radiocheck) { string pattern = "<td (?<data>.*?)</td>"; Regex r = new Regex(pattern, RegexOptions.Singleline); PostedJobsLog log = PostedJobsLog.Create; string EncryptedJID = MatchEncryptedJID(p); string text = null; int jobcount = 0; foreach (Match i in r.Matches(p)) { jobcount++; PostedJobs job = new PostedJobs(); string JobNameTemp = MatchName(i.Groups["data"].Value).Replace("/", "-").Trim(); job.Date = MatchJobDate(p); if (radiocheck == true && String.IsNullOrEmpty(job.Date) == false) { DateTime AppliedDate = new DateTime(); AppliedDate = IsAppliedEarlier(job.Date); if (DateTime.Compare(AppliedDate, date1) < 0) { continue; } if (DateTime.Compare(AppliedDate, date2) > 0) { continue; } } if (JobNameTemp.Length > 3) { job.Name = JobNameTemp.Replace("‎", "").Trim(); if (log.Contains(job.Name.Trim()) == false) { OnInformationDownload(new EventArguments() { Name = "Counting Jobs" + jobcount + " ", Details = job.Name, Date = DateTime.Now }); job.Link = "http://hiring.rozee.pk/" + MatchLink(i.Groups["data"].Value); job.TotalApplicants = MatchParticipants(p); job.Status = MatchActivation(p); job.EncryptedJobID = EncryptedJID + "=&"; log.JobsList.Add(job); text = null; } } } return(text); }