我有个想法应该可行:加入一段javascript 代码
判断location属性如果不是当前域 则替换部分关键内容前提是这段代码必须也被复制并被执行 可以放到一起后混淆代码或加密增加解读难度。另外所有这些手段都只能增解读难度而已
判断location属性如果不是当前域 则替换部分关键内容前提是这段代码必须也被复制并被执行 可以放到一起后混淆代码或加密增加解读难度。另外所有这些手段都只能增解读难度而已
调试欢乐多
我说一下我的思路吧你做一个隐藏的textarea,复制的时候先把内容填到这个textarea里面,然后再将textarea里面的内容编辑成你想要的效果,再把textarea的内容放在剪切板上.思路就是这样,应该是可行的,只是实现起来有些细节比较麻烦.我在上班没有太多时间做,用这思路再给点时间应该能实现了
{
protected string m_StyleSrc = string.Empty;private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
m_StyleSrc = //你获取地址的方法
}
}界面上
<LINK href="<%=m_StyleSrc%>" type="text/css" rel="stylesheet">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> - http://www.never-online.net </title>
<meta http-equiv="ImageToolbar" content="no" />
<meta name="author" content="never-online, BlueDestiny"/>
<script type="text/javascript">
//<![CDATA[
function copyEventHandler() {
var a = window.clipboardData.getData("Text");
var x = document.getElementById("demo");
x.value = "原始内容为" +a+ "\n\n";
a = a.replace(/never\-online/g, "http://www.never-online.net");
x.value += "\n\n替换内容为" +a;
window.clipboardData.setData("Text", a);
}
//]]>
</script>
</head>
<body id="www.never-online.net" oncopy="copyEventHandler();">
<div id="htmldivision">never-online</div>
<textarea style="width:500px; height:300px;" id="demo">
</textarea>
</body>
</html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> - http://www.never-online.net </title>
<meta http-equiv="ImageToolbar" content="no" />
<meta name="author" content="never-online, BlueDestiny"/>
<script type="text/javascript">
//<![CDATA[
onload = function() {
window.x = document.getElementById("htmlEditor").contentWindow.document;
x.open();
x.write("<body contentEditable=true>");
x.close();
window.clipboardData.clearData();
}
function copyEventHandler() {
var r = document.selection.createRange();
var n = x.body;
n.focus();
n.innerHTML = r.htmlText;
n.innerHTML=n.innerHTML.replace(/never\-online/ig,"<a href='http://blog.never-online.net'>never-online's blog</a>")+'<p> never-online </p>';
x.execCommand("Copy");
}
//]]>
</script>
</head>
<body id="www.never-online.net" oncopy="copyEventHandler();">
把下面这段全部复制,注意下面的iframe<br/>
<div id="htmldivision">never-online</div>
<img src="http://community.csdn.net/logo/images/prj.210.67.gif"/><br/>
<br/>
<iframe id="htmlEditor" width="500" height="300"></iframe>
</body>
</html>