|
本帖最后由 lcylcyll 于 2013-8-28 00:01 编辑
- <div class="blockcode"><blockquote>foreach (Match item1 in Regex.Matches(html1, @"<div class=""enter_id""><span>(.*?)</span></div>
- <div class=""enter_sc""><span>(.*?)</span></div>
- <div class=""enter_sjd""><span>(.*?)</span></div>
- <div class=""enter_xz""><span>(.*?)</span></div>
- "))
- {
- string n1 = item1.Groups[1].Value;
- string n2 = item1.Groups[2].Value;
- string n3 = item1.Groups[3].Value;
- string n4 = item1.Groups[4].Value;
- textBox2.Text = n4;
- }
复制代码
上面这一个是代码 是这样写的对吧 可以看到测试是可以得出来结果的
这一个是要取的文本
<tr class="tf" >
<td colspan="7">
<div class="yuan">
<div class="enter_id"><span>1</span></div>
<div class="enter_sc"><span>TKTBJ</span></div>
<div class="enter_sjd"><span>2013-08-27</span></div>
<div class="enter_xz"><span>0时10分</span></div>
<input type='hidden' class='state' value='' />
<div class="enter_caozuo">
<span class="ticket_del" style="color:#046F8F;cursor:pointer;">删除</span>
</div>
<div class="enter_bz"><span></span></div>
<div class="enter_chk"><input type="checkbox" name="checkbox2" /></div>
</div>
<!-- 点开始-->
<div class="dian">
<div class="enterid"><span>1</span></div>
<div class="entersc"><input type="text" name="entersc" class="input2" value="TKTBJ"/ ></div>
<div class="entersjd"><input type="text" name="enteryxq" class="Wdate" value="2013-08-27"/ ></div>
<div class="enterxz"><input type="text" name="enterxz" class="shi" value='0'/ > 时 <input type='text' class='fen' value='10'/> 分</div>
<div class="entercaozuo">
<input type="button" class="tj" value="确定"/> <input type="button" value="取消" class="qx" /></div>
<div class="enterbz"><input type="text" name="enterbzhu" class="input5" value=""/></div>
<div class="enterchk"><input type="checkbox" name="checkbox2" checked/> </div>
</div>
<!-- 点结束-->
</td>
</tr>
<tr class="tf" >
<td colspan="7">
<div class="yuan">
<div class="enter_id"><span>2</span></div>
<div class="enter_sc"><span>JLBDU</span></div>
<div class="enter_sjd"><span>2013-08-27</span></div>
<div class="enter_xz"><span>0时10分</span></div>
<input type='hidden' class='state' value='' />
<div class="enter_caozuo">
<span class="ticket_del" style="color:#046F8F;cursor:pointer;">删除</span>
</div>
<div class="enter_bz"><span></span></div>
<div class="enter_chk"><input type="checkbox" name="checkbox2" /></div>
</div>
红色的就是我要取的数据,但是在窗口程序中取不出来,一个值都取不了
对了还有问一下如果要关闭子窗口的话怎么样才能把主窗口关闭,也就是整一个窗口退出
|
|