How received number in my textbox1 using windows form?

余生长醉 提交于 2019-12-25 05:45:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!