⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 postprocessor.cs

📁 一个基于 Internet Explorer 中 MSHTML 技术的 ASP.NET 服务器控件
💻 CS
字号:
using System;
using System.Collections;
using System.Text;
using System.Text.RegularExpressions;
using FreeTextBoxControls;


namespace FreeTextBoxControls.Common
{
	/// <summary>
	/// Handles HTML processing 
	/// </summary>
	public class PostProcessor
	{
		/// <summary>
		/// Removes the local servername from A and IMG tags
		/// </summary>
		public string RemoveServerNameFromUrls(string input, string servername)
		{
			System.Web.HttpContext.Current.Trace.Write("ServerName",servername);
			input = Regex.Replace(input,"HREF=http://" + servername,"HREF=",RegexOptions.IgnoreCase);
			input = Regex.Replace(input,"HREF=\"http://" + servername,"HREF=\"",RegexOptions.IgnoreCase);
			input = Regex.Replace(input,"src=http://" + servername,"src=",RegexOptions.IgnoreCase);
			input = Regex.Replace(input,"src=\"http://" + servername,"src=\"",RegexOptions.IgnoreCase);
			return input;
		}
		/// <summary>
		/// Removes the scriptname from bookmarks (#mark).
		/// </summary>
		public string RemoveScriptNameFromBookmarks(string input, string serverName, string url, string qString)
		{
			System.Web.HttpContext.Current.Trace.Write("Bookmark",serverName + url + "?" + qString);
			input = input.Replace("href=\"http://" + serverName + url + "?" + qString,"href=\"");
			input = input.Replace("href=http://" + serverName + url + "?" + qString,"href=");
			return input;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -