使用Windows窗体如何在我的textbox1中接收数字? [英] How received number in my textbox1 using windows form?

查看:155
本文介绍了使用Windows窗体如何在我的textbox1中接收数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请在下面的html代码中查看我想要的文本框区域中的数字. 我正在尝试许多过程,但仍未得到任何解决方案,因此请检查html代码并提供正确的解决方案.

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.

当我刷新页面时,数字总是在变化. 数字不会完全改变,只有最后7位数字会改变,但始终显示206的前3位数字.

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>

推荐答案

您可以使用以下基于RegEx的解决方案.我假设您的html页面的格式不变.

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);
}

这篇关于使用Windows窗体如何在我的textbox1中接收数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆