The sample represents simple ICMP client for C# .NET with Ping functionality.
 
 
private string GetCellText(HtmlTableCell tableCell)
{
	string result = "";
	foreach (HtmlTag tag in tableCell.Tags)
	{
		if (tag.IsText)
		{
			result += tag.Text;
		}
	}

	return result.Trim();
}

private void button1_Click(object sender, EventArgs e)
{
	htmlParser1.ParseMethod = ParseMethod.All;
	htmlParser1.Parse(textBox1.Lines);

	textBox2.Clear();

	for (int i = 0; i < htmlParser1.Tables.Count; i++)
	{
		textBox2.AppendText(String.Format("table {0}\r\n", i));

		HtmlTable table = htmlParser1.Tables[i];
		for (int j = 0; j < table.Rows.Count; j++)
		{	
			textBox2.AppendText(String.Format("row {0}\r\n", j));
			HtmlTableRow row = table.Rows[j];

			for (int k = 0; k < row.Cells.Count; k++)
			{
				HtmlTableCell cell = row.Cells[k];
				textBox2.AppendText(GetCellText(cell) + "\r\n");
			}
		}
	}
}

Add Feedback