c#从html中获取图片地址
using System.Text.RegularExpressions;
string ohtml = this.TextBox1.Text;
System.Text.RegularExpressions.MatchCollection m;
//提取字符串的图片
m = Regex.Matches(ohtml, "(<img).*?>");
for (int i = 0; i < m.Count; i++)
{
string ostr = m[i].ToString();
//提取图片的地址
System.Text.RegularExpressions.MatchCollection m2;
m2 = Regex.Matches(ostr, "(src=)['|\"].*?['\"]");
for (int j = 0; j < m2.Count; j++)
{
string strTemp = m2[j].ToString();
strTemp = strTemp.Replace("src=", "");
strTemp = strTemp.Replace("\"", "");
strTemp = strTemp.Replace("'", "");
 
相关文档:
已知有一个XML文件(bookstore.xml)如下:
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
<author>Corets, Eva</author>
&nb ......
HTML 是 Web 统一语言,这些容纳在尖括号里的简单标签,构成了如今的 Web。1991 年,Tim Berners-Lee
编写了一份叫做 “HTML 标签”的文档,里面包含了大约20个用来标记网页的 HTML 标签。他直接借用 SGML
的标记格式,也就是后来我们看到的 HTML 标记的格式。本文讲述了 HTML 这门 Web 标记语言的发展简史。
......
<select name="CluefromType" id="CluefromType" style="width: 182px" onchange="return CluefromOtherTypeSelected();">
<option value="市场走访">
市场走访
< ......
在web程序中,经常会使用在一个网页使用其他网页提交的数据信息,这里可以使用Request内置对象来完成,来获取用户提交的信息,根据客户端提交数据方式的不同,Request对象分别使用Form和QueryString集合属性来获取数据。下面是两种集合获取方式的不同点:通过Form获取数据时在form属性中简单的添加action=“跳转的网页 ......