xla.Cells[add, 4] = anchorlist;
Match hrefcheck = hrefRegex.Match(htmlpage); ArrayList linklist = new ArrayList(); // linklist.Add("<BASE href=\"" + url + "\">" + url); ArrayList anchorlist = new ArrayList(); while (hrefcheck.Success) { string href = hrefcheck.Groups["href"].Value; //link url string attr = hrefcheck.Groups["Anchor"].Value; anchorlist.Add(attr); linklist.Add(href); hrefcheck = hrefcheck.NextMatch(); } string matchurl = "xyz.com"; foreach (string str in linklist) { if (str.Contains(matchurl) == true) { Microsoft.Office.Interop.Excel.Application xla = new Microsoft.Office.Interop.Excel.Application(); Workbook wb = xla.Workbooks.Add(XlSheetType.xlWorksheet); Worksheet ws = (Worksheet)xla.ActiveSheet; xla.Visible = true xla.Cells[add, 1] = urltextBox.Text; xla.Cells[add, 2] = str; xla.Cells[add, 3] = s; xla.Cells[add, 4] = anchorlist; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)