右键菜单[写入注册表]读取所选文字图片并将地址发送到指定页面!

类别:Asp 点击:0 评论:0 推荐:

注册表文件

REGEDIT4


[-HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\+ Offline &Explorer: Download the link]

[-HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\+ Offline E&xplorer: Download the current page]

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt]

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\asthlon-推荐给朋友]
@="http://localhost/songcak/songcak/MouseAdd/index.aspx"

index.aspx 文件

<script LANGUAGE="JavaScript">
//asthlon
function getfullpath(url)
{
var iIndex=url.lastIndexOf('/');
if(iIndex!=-1)
{
return url.substring(0,iIndex+1);
}
else
return url;
}


if (external.menuArguments) {
var parentwin = external.menuArguments;
var tp = '&tp=txt';
if (parentwin.document.selection) {
var sel = parentwin.document.selection.createRange().text;
}

if (!sel) {
var sel = '';
}

var url = parentwin.location.href;
var title = parentwin.document.title;

if (parentwin.event.srcElement.tagName == "A") {
url = parentwin.event.srcElement.getAttribute("HREF");
title = parentwin.event.srcElement.innerText;
}
else if(parentwin.event.srcElement.tagName == "IMG")
{
url = parentwin.event.srcElement.getAttribute("SRC");
tp = '&tp=pic';
}
void(window.open(getfullpath(document.location.href)+'../Add.aspx?t='+escape(title)+'&u='+escape(url)+'&c='+escape(sel) + tp,'PostTie'))
} else {
//history.go(-1);
}
//window.open('add.aspx','PostTie','')
window.open(getfullpath(document.location.href)+'Add.aspx?t='+escape(title)+'&u='+escape(url)+'&c='+escape(sel) + tp,'PostTie','')
</script>

add.aspx 文件为接收请求处理文件

本文地址:http://com.8s8s.com/it/it7105.htm