<table>
Security code: <span style="font-family:'Segoe UI Bold', 'Segoe UI Semibold', 'Segoe UI', 'Helvetica Neue Medium', Arial, sans-serif;font-size:14px;font-weight:bold;color:#2a2a2a;">9949598</span>
</td>
我希望在 Windows 窗体应用程序区域的文本框中显示代码。
下面的代码是我在我的文本框区域尝试这个但没有成功。
请帮助我。
HtmlElementCollection bColl = webBrowser1.Document.GetElementsByTagName("span");
foreach (HtmlElement bEl in bColl)
{
if (bEl.GetAttribute("style").Contains("Arial, sans-serif;font-size:14px;font-weight:bold;color:#2a2a2a"))
txtLinkDetails.Text = bEl.OuterHtml.Split('"')[3];
}