页面数据操作
来源:互联网 发布:什么是数据割接 编辑:程序博客网 时间:2024/06/05 00:31
/// 将Html标签转化为空格
/// </summary>
/// <param name="strHtml">待转化的字符串</param>
/// <returns>经过转化的字符串</returns>
private string stripHtml(string strHtml)
<img none';="" codehighlighter1_175_390_open_text.style.display="none" ;="" codehighlighter1_175_390_closed_image.style.display="inline" codehighlighter1_175_390_closed_text.style.display="inline" ;"="" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top" twffan="done" style="border: 0px; max-width: 100%;"> {
Regex objRegExp = new Regex("<(.|\n)+?>");
string strOutput = objRegExp.Replace(strHtml, "");
strOutput = strOutput.Replace("<", "<");
strOutput = strOutput.Replace(">", ">");
return strOutput;
}
//把所有空格变为一个空格
Regex r = new Regex(@"\s+");
wordsOnly = r.Replace(strResponse, " ");
wordsOnly.Trim();
// 解析页面,查找链接
// 此处尚需扩展,还有某些形式的链接不被识别
string strRef = @"(href|HREF|src|SRC|action|ACTION|Action)[ ]*=[ ]*[""'][^""'#>]+[""']";
MatchCollection matches = new Regex(strRef).Matches(strResponse);
strStatus += "找到: "+matches.Count+" 个链接\r\n";
//获取标题
Match TitleMatch = Regex.Match(strResponse, "<title>([^<]*)</title>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
title = TitleMatch.Groups[1].Value;
//获取描述信息
Match Desc = Regex.Match(strResponse, "<Meta name=\"DESCRIPTION\" content=\"([^<]*)\">", RegexOptions.IgnoreCase | RegexOptions.Multiline);
strdesc = Desc.Groups[1].Value;
//获取网页的大小
size = strResponse.Length;
<img none';="" codehighlighter1_2_129_open_text.style.display="none" ;="" codehighlighter1_2_129_closed_image.style.display="inline" codehighlighter1_2_129_closed_text.style.display="inline" ;"="" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top" twffan="done" style="line-height: 22px; border: 0px; max-width: 100%; color: rgb(51, 51, 51); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 13px;"> /// <summary>
/// 将Html标签转化为空格
/// </summary>
/// <param name="strHtml">待转化的字符串</param>
/// <returns>经过转化的字符串</returns>
private string stripHtml(string strHtml)
<img none';="" codehighlighter1_175_390_open_text.style.display="none" ;="" codehighlighter1_175_390_closed_image.style.display="inline" codehighlighter1_175_390_closed_text.style.display="inline" ;"="" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top" twffan="done" style="border: 0px; max-width: 100%;"> {
Regex objRegExp = new Regex("<(.|\n)+?>");
string strOutput = objRegExp.Replace(strHtml, "");
strOutput = strOutput.Replace("<", "<");
strOutput = strOutput.Replace(">", ">");
return strOutput;
}
- 页面数据操作
- JQuery 数据加载中禁止操作页面
- react-native 页面跳转与数据操作
- 完成用户注册、登录页面,实现数据的真实操作。
- 多页面同步数据,同步操作,非长链接
- 将后台数据取出放到页面的后台操作对比
- js 操作 ftl 页面中的动态表格数据
- WEB页面_批量操作提交数据(批量删除)
- Javaweb开发,实现'购物车'的遍历与操作(页面数据刷新、后台操作反馈)
- ###(很难找的页面错误)查询操作不需要 返回 操作成功后失败。【方法不能同时执行两个response返回两次数据。导致页面显示数据失败】
- asp.net中一个页面跳转,后一个页面操作内容后返回先前页面,并使得先前页面数据刷新
- ASP.NET 2.0中的数据操作 :: 跨页面的主/从报表
- css控制页面列表数据操作超出长度变为三点
- 数据操作后,页面alert提示例子3-后台js打印提示信息并重定向
- 多用户操作从mysql数据库传输到前台页面的数据
- jquery 处理页面弹出层查询数据等待的操作(gif图片加载等待)
- js操作从后台传到jsp页面上的list数据
- 第一周,后台取数据做成表单highchart图到freemarker页面,ajax操作
- 操作符重载和友元的关系
- wget从oracle网站中下载jdk
- C# struc的陷阱 (无法修改""的返回值,因为他不是变量)
- iOS 开发-理解Certificate、AppId和Provisioning Profile
- Starting application at 0x81000000 ...
- 页面数据操作
- uva 10453 Make Palindrome(dp,最小回文生成)
- Linux下安装tar、rpm、dpkg(deb)软件包
- Eclipse中java文件和jsp字体大小设置
- 二、C++迭代器的两种实现方式 (Range for和C#、Java中的foreach)
- AutoCompleteTextView的简单例子
- 服务端按钮同时调用onserverclick和onclick时,onserverclick不执行
- C#文件及文件夹的复制
- 眨眼理论