随笔分类 -  ASP.NET

摘要:该类其功能相当于浏览器对当前页面内链接地址的解析功能主要方法是 字符串的操作,正则表达式的匹配和替换。比如所当前页为:http://www.test.com/list/page.aspx?id=12,其页面内链接为:BaseUrlResult/default.aspx?id=14http://www.test.com/default.aspx?id=14../details.aspx?id=4http://www.test.com/details.aspx?id=4dete.aspxhttp://www.test.com/list/dete.aspx该类C#代码:using System;us 阅读全文
posted @ 2013-05-06 16:47 yyutudou 阅读(443) 评论(0) 推荐(0)
摘要:/// <summary> /// 添加JS脚本链接 /// </summary> /// <param name="page">页面</param> /// <param name="url">路径</param> public static void AddJS(System.Web.UI.Page page, string url) { HtmlGenericControl jsControl = new HtmlGenericControl("script" 阅读全文
posted @ 2012-06-01 16:07 yyutudou 阅读(192) 评论(0) 推荐(0)
摘要:/// <summary> /// 去除HTML标记 /// </summary> /// <param name="NoHTML">包括HTML的源码</param> /// <returns>已经去除后的文字</returns> public static string RemoveHTMLCode(string HtmlCode) { //删除脚本 HtmlCode = Regex.Replace(HtmlCode, @"<script[^>]*?>.*?</sc 阅读全文
posted @ 2012-04-10 09:51 yyutudou 阅读(588) 评论(0) 推荐(0)