问题
please see below html code in there I am want number in my textbox area. I am trying many process but still not getting any solution so please check html code with give me right solution.
Number always going change when I am refresh page. Number not going change fully only last 7 digit going change but always show 206 first 3digit.
If you have any good code then please share with me full details. I am new In the coding area so your help setting my many work.
<table>
<tr><td><b>Phone Number:</b> 206-755-2000</td></tr>
<tr><td><b>Security Code:</b> 3412</td></tr>
<tr><td><b>Email:</b>kennethdasma30@gmail.com</td></tr>
<tr><td><b>File Format:</b> dbg</td></tr>
</table>
回答1:
You may use the following RegEx based solution. I'm assuming that the format of your html page doesn't change.
Regex re = new Regex(@"(?<=<tr><td><b>Phone\sNumber:</b>\s?)206-[-\d]+?(?=</td></tr>)", RegexOptions.Singleline);
foreach (Match match in re.Matches(webBrowser1.DocumentText))
{
listBox1.Items.Add(match.Value);
}
来源:https://stackoverflow.com/questions/32423115/how-received-number-in-my-textbox1-using-windows-form