public partial class Form1 : Form { string location1, location2; public delegate void AddRowToGridViewDelegate(string r1, string r2); AddRowToGridViewDelegate addRowToGridViewDelegateobject; public Form1() { InitializeComponent(); addRowToGridViewDelegateobject = new AddRowToGridViewDelegate(AddRowToGridViewfunction); } void AddRowToGridViewfunction(string r1, string r2) { string[] data = { r1, r2}; dataGridView1.Rows.Add(data); } void GetAllData2(string res2, string link2) { location1 = ""; location2 = ""; try { string[] wh1 = Regex.Split(res2, "<div id=location><a href=\"index.asp\">"); string[] wh3 = Regex.Split(wh1[1], ".asp\">"); string[] wh4 = Regex.Split(wh3[0], "<"); location1 = wh4[0].Replace(",", ""); } catch { } try { string[] wh1 = Regex.Split(res2, "<div id=location><a href=\"index.asp\">"); string[] wh3 = Regex.Split(wh1[1], ".asp\">"); string[] wh5 = Regex.Split(wh3[1], "<"); location2 = wh5[0].Replace(",", ""); } catch { } string data = location1 + "," + location2; this.Invoke(addRowToGridViewDelegateobject, location1,location2); thanks in advance
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)