public void GetImageFromUrl(string pUrl) { HtmlTool ahHtmlTool = new HtmlTool(); string url = pUrl; string result = ""; var listImageLink = ahHtmlTool.FetchLinksFromSource(url); DataTable dt = new DataTable(); dt.Columns.Add("link"); foreach (var alink in listImageLink) { dt.Rows.Add(alink); } dtlListImage.DataSource = dt; dtlListImage.DataBind(); }
public void getImageFromUrl(string pUrl) { HtmlTool ahHtmlTool = new HtmlTool(); string url = pUrl; string result = ""; var listImageLink = ahHtmlTool.FetchLinksFromSource(url); int i = 0, j = 0; foreach (var alink in listImageLink) { j++; i++; if (j == 1) { result += "<div class='box1'>"; } else if (j == 5) { result += "<div class='clear'></div>"; result += "</div>"; j = 0; } else { result += "<div class='col_1_of_single1 span_1_of_single1'>"; result += "<div class='view1 view-fifth1'>"; result += "<div class='top_box'>"; result += "<div class='m_2'>"; result += "<input class='second' name='option2' type='checkbox' id='" + i + "' value='" + alink + "' />"; result += "<label class='label2' for='" + i + "'>Choose image</label>"; result += "</div>"; result += " <div class='grid_img'><div class='css3'>"; result += "<img src='" + alink + "' alt='' /><br /><input type='text' value='" + alink + "' />"; result += " </div> </div> </div> </div> </div>"; } } if (listImageLink.Count % 4 != 0) { result += "<div class='clear'></div>"; result += "</div>"; } lblResult.Text = result; }
public void GetImageFromUrl(string pUrl) { HtmlTool ahHtmlTool = new HtmlTool(); if (pUrl.Contains("www.cars.com")) { pUrl = pUrl.Replace("overview", "photo"); } string url = pUrl; string result = ""; var listImageLink = ahHtmlTool.FetchLinksFromSource(url); DataTable dt = new DataTable(); dt.Columns.Add("link"); foreach (var alink in listImageLink) { dt.Rows.Add(alink); } dtlListImage.DataSource = dt; dtlListImage.DataBind(); }