public string GetData() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Name=" + Name); sb.AppendLine("Position=" + Position); sb.AppendLine("BirthDate=" + BirthDate.ToString("MMMM dd, yyyy", UsCulture)); sb.AppendLine("Salary=" + Salary.ToString("C", UsCulture)); sb.AppendLine("Biography=" + Biography); sb.AppendLine("Photo=" + PhotoFileName.Replace("~", "..")); return(sb.ToString()); }
private void setPhoto(HtmlNode nodeCard, String xPath) { try { //HtmlNode node = nodeCard.SelectSingleNode(xPath); //this.PhotoFileName = node.GetAttributeValue("src", "").Replace(@"/", @"\"); this.PhotoFileName = Utilities.HtmlAgilityPackExtension.GetAttributeValue(nodeCard, xPath, "src", ""); if (!String.IsNullOrEmpty(this.PhotoFileName)) { this.PhotoFileName = PhotoFileName.Replace(@"/", @"\"); this.PhotoFileName = System.IO.Path.Combine(this._FolderName, this.PhotoFileName.Remove(0, 2)); this.Photo = Image.FromFile(this.PhotoFileName); } } catch (Exception ex) { this.Errors.Add("Photo", ex.Message); this.Photo = null; } }