16,554
社区成员
发帖
与我相关
我的任务
分享
private Int32 GetTableRowCount(string tableID)
{
Int32 count = 0;
if (webBrowser1.Document != null)
{
HtmlElement tableElem = webBrowser1.Document.GetElementById(tableID);
if (tableElem != null)
{
foreach (HtmlElement aElem in tableElem.GetElementsByTagName("a"))
{
//判断InnerText是不是"课程属性成绩"
if (aElem.InnerText.Equals("课程属性成绩"))
{
aElem.InvokeMember("Click");
break;
}
}
}
else
{
throw(new ArgumentException("No TABLE with an ID of " + tableID + " exists."));
}
}
return(count);
}