void tiqu()
{
string Detail = "<p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>张无忌、令狐冲、小龙女、黄药师&hellip;&hellip;</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>各个耳熟能详的名字</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>都是我们曾经的梦</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'>&nbsp;</p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>现在,要成为武林高手的梦幻</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>终于实现啦</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'>&nbsp;</p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>武林秘籍笔记本</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>带着这样一本秘籍放在怀里</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>肯定吸爆所有人的眼球</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>看着别人羡慕的眼神</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>你一脸淡然地捧着秘籍</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>仔细阅读里面的公司报告</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>学习记录</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'>&nbsp;</p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体'>哈哈,是不是特别酷呢?<br />化骨绵掌,字样写法多样,发货随机</font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体' size='3'><img alt='' border='0' src='http://www.ywybsc.com.cn/product/images/UploadFile/2010-4/7/20104713252822.jpg' /><br /><img alt='' border='0' src='http://www.ywybsc.com.cn/product/images/UploadFile/2010-4/7/2010471454218.jpg' /><br /><img alt='' border='0' src='http://www.ywybsc.com.cn/product/images/UploadFile/2010-4/7/20104714726561.jpg' /><br /><img alt='' border='0' src='http://www.ywybsc.com.cn/product/images/UploadFile/2010-4/7/20104714737108.jpg' /><br /><img alt='' border='0' src='http://www.ywybsc.com.cn/product/images/UploadFile/2010-4/7/20104714745271.jpg' /><br /><img alt='' border='0' src='http://www.ywybsc.com.cn/product/images/UploadFile/2010-4/7/2010471331771.jpg' /><img alt='' border='0' src='http://www.ywybsc.com.cn/product/images/UploadFile/2010-4/7/2010471339997.jpg' /></font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'><span style='font-size: 12pt; font-family: 黑体'><font face='宋体' size='3'><img alt='' src='http://www.ywybsc.com.cn/product/NewWebPic/FckPic/201005290450007031.jpg' /></font></span></p><p style='margin: 0cm 0cm 0pt; text-align: center' align='left'>&nbsp;</p>";
string pimg = @"(?is)(?<=<.*?img.*?)src=(['""]?)[^'"" ]+\1";
MatchCollection mc = Regex.Matches(Detail, pimg, RegexOptions.IgnoreCase);
string redetail = string.Empty;
for (int i = 0; i < mc.Count; i++)
{ string content = mc[i].Value.Replace("src='", " ").Replace("'", " ").Trim(); string temUrl = content.Substring(0, content.LastIndexOf('/')); redetail = Detail.Replace(temUrl, ImgWeb + "/upload/FckPic");//下一次替换在上一次替换基础上再替换?(保存上一次替换结果重新赋给Detail) }
Response.Write(redetail);//输入的只是和循环最后一次要替换的
}
解决方案 »
- 只能在执行 Render()的过程中调用 RegisterForEventValidation
- web可以用全局变量吗?
- response.write()下载问题.
- treeview 的 web ctrl_client 文件夹能不能不放在wwwroot里,而是放在我的页面文件所在的文件里?
- datagrid中链接的问题
- 修改后的数据如何自动刷新?
- 如何在框架中传递参数,如何让鼠标停留在TREEVIEW上时显示个提示栏(急)
- 急!急!急!求高手、大虾帮忙!菜鸟求教
- 问一个XmlHttp返回数据的问题??????
- 关于网站设计中XML的使用,请教各位高手了!
- 如何做像QQ邮箱一样的弹窗口?
- 值不存在,隐藏控件
Detail = Detail.Replace(temUrl, ImgWeb + "/upload/FckPic");
Response.Write(Detail);
//....
redetail = redetail.Replace(temUrl, ImgWeb + "/upload/FckPic");